Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P651
Command-Line Input
Active
Public
Actions
Authored by
jhb
on Wed, Nov 20, 10:04 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F103095165: Command-Line Input
Wed, Nov 20, 10:04 PM
2024-11-20 22:04:47 (UTC+0)
Subscribers
None
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 2dbe1072aa83..0b8030904463 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -2592,6 +2592,8 @@ device_attach(device_t dev)
if (resource_disabled(dev->driver->name, dev->unit)) {
device_disable(dev);
+ (void)device_set_driver(dev, NULL);
+ dev->state = DS_NOTPRESENT;
if (bootverbose)
device_printf(dev, "disabled via hints entry\n");
return (ENXIO);
@@ -5759,17 +5761,20 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
* attach the device rather than doing a full probe.
*/
device_enable(dev);
- if (device_is_alive(dev)) {
+ if (dev->devclass != NULL) {
/*
* If the device was disabled via a hint, clear
* the hint.
*/
- if (resource_disabled(dev->driver->name, dev->unit))
- resource_unset_value(dev->driver->name,
+ if (resource_disabled(dev->devclass->name, dev->unit))
+ resource_unset_value(dev->devclass->name,
dev->unit, "disabled");
- error = device_attach(dev);
- } else
- error = device_probe_and_attach(dev);
+
+ /* Allow any drivers to rebid. */
+ if (!(dev->flags & DF_FIXEDCLASS))
+ devclass_delete_device(dev->devclass, dev);
+ }
+ error = device_probe_and_attach(dev);
break;
case DEV_DISABLE:
if (!device_is_enabled(dev)) {
Event Timeline
jhb
created this paste.
Wed, Nov 20, 10:04 PM
2024-11-20 22:04:47 (UTC+0)
Log In to Comment