Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jun 2011 19:02:56 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223513 - head/sys/dev/usb
Message-ID:  <201106241902.p5OJ2uCL066639@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106241902.p5OJ2uCL066639>