diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-03-13 17:07:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 19:10:26 -0700 |
commit | 3f62e5700b2a679ae987b32a68126dd6dcf2488f (patch) | |
tree | 4f8eda958d328b6fc068409c0fb464bc7c21266b /drivers/base | |
parent | 9a3df1f7de0ecaf77a1dde86f2a4dc020f37f87e (diff) | |
download | linux-3f62e5700b2a679ae987b32a68126dd6dcf2488f.tar.gz linux-3f62e5700b2a679ae987b32a68126dd6dcf2488f.tar.bz2 linux-3f62e5700b2a679ae987b32a68126dd6dcf2488f.zip |
Driver core: make device_is_registered() work for class devices
device_is_registered() can use the kobject value for this, so it will
now work with devices that are associated with only a class, not a bus
and a driver.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 2d207ad30336..450942acca1a 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -505,14 +505,11 @@ void bus_attach_device(struct device *dev) int ret = 0; if (bus) { - dev->is_registered = 1; if (bus->p->drivers_autoprobe) ret = device_attach(dev); WARN_ON(ret < 0); if (ret >= 0) klist_add_tail(&dev->knode_bus, &bus->p->klist_devices); - else - dev->is_registered = 0; } } @@ -533,10 +530,8 @@ void bus_remove_device(struct device *dev) sysfs_remove_link(&dev->bus->p->devices_kset->kobj, dev->bus_id); device_remove_attrs(dev->bus, dev); - if (dev->is_registered) { - dev->is_registered = 0; - klist_del(&dev->knode_bus); - } + klist_del(&dev->knode_bus); + pr_debug("bus: '%s': remove device %s\n", dev->bus->name, dev->bus_id); device_release_driver(dev); |