Page MenuHomeFreeBSD

D52050.id170653.diff
No OneTemporary

D52050.id170653.diff

diff --git a/lib/libdevctl/devctl.3 b/lib/libdevctl/devctl.3
--- a/lib/libdevctl/devctl.3
+++ b/lib/libdevctl/devctl.3
@@ -193,6 +193,7 @@
the device will be detached from its current device driver.
After the device's name is reset,
it is reprobed and attached to a suitable device driver if one is found.
+If no suitable device driver is found, no error is reported.
.Pp
The
.Fn devctl_rescan
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -5961,7 +5961,18 @@
dev->flags &= ~DF_FIXEDCLASS;
dev->flags |= DF_WILDCARD;
devclass_delete_device(dev->devclass, dev);
- error = device_probe_and_attach(dev);
+ /*
+ * Don't use device_probe_and_attach so that failing to find a new driver
+ * isn't reported as an error.
+ */
+ error = device_probe(dev);
+ if (error == ENXIO) {
+ error = 0;
+ break;
+ }
+ if (error == 0) {
+ error = device_attach(dev);
+ }
break;
case DEV_RESCAN:
if (!device_is_attached(dev)) {

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 30, 2:42 AM (10 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32436249
Default Alt Text
D52050.id170653.diff (1014 B)

Event Timeline