diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2001-01-08 22:16:26 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2001-01-08 22:16:26 +0000 |
commit | cfd616810dc740e22f6bce0439a23db59cf1f8c1 (patch) | |
tree | dc7f10fde3f76b81bbf4c1a0df45662d63b753e3 /sys/kern/subr_bus.c | |
parent | e42ccf8d79ffa7c3eab7b0edc9826a39595da584 (diff) | |
download | FreeBSD-src-cfd616810dc740e22f6bce0439a23db59cf1f8c1.zip FreeBSD-src-cfd616810dc740e22f6bce0439a23db59cf1f8c1.tar.gz |
Unset the devclass if the attach fails and the devclass was not set to
begin with.
Reviewed by: dfr
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r-- | sys/kern/subr_bus.c | 4 |
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; } |