summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2011-06-24 19:02:56 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2011-06-24 19:02:56 +0000
commitd43ffe946528531ec23ba4271a90bcefd6da6da5 (patch)
treecb34baffb300a43390547a84494a2cac20d5e664 /sys/dev/usb
parenta6b60150631ab8ada529a0f3d39e4793fcda76ab (diff)
Notes
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usb_device.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c
index 76c976b70cdd2..932c0222272b2 100644
--- a/sys/dev/usb/usb_device.c
+++ b/sys/dev/usb/usb_device.c
@@ -1358,17 +1358,18 @@ usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index)
uaa.info.bIfaceIndex,
uaa.info.bIfaceNum);
- if (usb_probe_and_attach_sub(udev, &uaa)) {
- /* ignore */
- }
- }
+ usb_probe_and_attach_sub(udev, &uaa);
- if (uaa.temp_dev) {
- /* remove the last created child; it is unused */
-
- if (device_delete_child(udev->parent_dev, uaa.temp_dev)) {
+ /*
+ * Remove the leftover child, if any, to enforce that
+ * a new nomatch devd event is generated for the next
+ * interface if no driver is found:
+ */
+ if (uaa.temp_dev == NULL)
+ continue;
+ if (device_delete_child(udev->parent_dev, uaa.temp_dev))
DPRINTFN(0, "device delete child failed\n");
- }
+ uaa.temp_dev = NULL;
}
done:
if (do_unlock)