summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 278599c..77ac35d 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1013,6 +1013,7 @@ device_probe_and_attach(device_t dev)
{
device_t bus = dev->parent;
int error = 0;
+ int hasclass = (dev->devclass != 0);
if (dev->state >= DS_ALIVE)
return (0);
@@ -1028,6 +1029,9 @@ device_probe_and_attach(device_t dev)
else {
printf("device_probe_and_attach: %s%d attach returned %d\n",
dev->driver->name, dev->unit, error);
+ /* Unset the class; set in device_probe_child */
+ if (!hasclass)
+ device_set_devclass(dev, 0);
device_set_driver(dev, NULL);
dev->state = DS_NOTPRESENT;
}
OpenPOWER on IntegriCloud