Author: hselasky
Date: Fri Jun 24 19:02:56 2011
New Revision: 223513
URL: http://svn.freebsd.org/changeset/base/223513

Log:
  - Ensure that we get all the required nomatch devd events.
  
  MFC after:    3 days

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c       Fri Jun 24 18:14:43 2011        
(r223512)
+++ head/sys/dev/usb/usb_device.c       Fri Jun 24 19:02:56 2011        
(r223513)
@@ -1358,17 +1358,18 @@ usb_probe_and_attach(struct usb_device *
                    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)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to