diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2008-11-13 21:46:19 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2008-11-13 21:46:19 +0000 |
commit | 1e9b4258a44bacd94b90d45ae7448a50a1bd3d1c (patch) | |
tree | 759a3eb31eeb9c102df46a9e3bf644496f522965 /sys | |
parent | 5e5f99e12aa2af18f2a02c849339c37c965f53a5 (diff) | |
download | FreeBSD-src-1e9b4258a44bacd94b90d45ae7448a50a1bd3d1c.zip FreeBSD-src-1e9b4258a44bacd94b90d45ae7448a50a1bd3d1c.tar.gz |
Silence detach messages if the device has marked itself quiet (u3g).
MFC after: 3 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/usb_subr.c | 26 | ||||
-rw-r--r-- | sys/kern/subr_bus.c | 3 |
2 files changed, 16 insertions, 13 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 324b435..29d044c 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -679,11 +679,11 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg) DPRINTF(("power exceeded %d %d\n", power,dev->powersrc->power)); /* XXX print nicer message. */ if (msg) - printf("%s: device addr %d (config %d) exceeds power " - "budget, %d mA > %d mA\n", - device_get_nameunit(dev->bus->bdev), dev->address, - cdp->bConfigurationValue, - power, dev->powersrc->power); + device_printf(dev->bus->bdev, + "device addr %d (config %d) exceeds " + "power budget, %d mA > %d mA\n", + dev->address, cdp->bConfigurationValue, + power, dev->powersrc->power); err = USBD_NO_POWER; goto bad; } @@ -1017,8 +1017,7 @@ usbd_new_device(device_t parent, usbd_bus_handle bus, int depth, bus, port, depth, speed)); addr = usbd_getnewaddr(bus); if (addr < 0) { - printf("%s: No free USB addresses, new device ignored.\n", - device_get_nameunit(bus->bdev)); + device_printf(bus->bdev, "No free USB addresses\n"); return (USBD_NO_ADDR); } @@ -1364,11 +1363,14 @@ usb_disconnect_port(struct usbd_port *up, device_t parent) if (dev->subdevs != NULL) { DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n")); for (i = 0; dev->subdevs[i]; i++) { - printf("%s: at %s", device_get_nameunit(dev->subdevs[i]), - hubname); - if (up->portno != 0) - printf(" port %d", up->portno); - printf(" (addr %d) disconnected\n", dev->address); + if (!device_is_quiet(dev->subdevs[i])) { + device_printf(dev->subdevs[i], + "at %s", hubname); + if (up->portno != 0) + printf(" port %d", up->portno); + printf(" (addr %d) disconnected\n", dev->address); + } + struct usb_attach_arg *uaap = device_get_ivars(dev->subdevs[i]); device_detach(dev->subdevs[i]); diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d7a7366..93a589a2 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2476,7 +2476,8 @@ device_detach(device_t dev) if ((error = DEVICE_DETACH(dev)) != 0) return (error); devremoved(dev); - device_printf(dev, "detached\n"); + if (!device_is_quiet(dev)) + device_printf(dev, "detached\n"); if (dev->parent) BUS_CHILD_DETACHED(dev->parent, dev); |