Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91402
b: refs/heads/master
c: 3f62e57
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Apr 20, 2008
1 parent 4500e2f commit a1b5987
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a3df1f7de0ecaf77a1dde86f2a4dc020f37f87e
refs/heads/master: 3f62e5700b2a679ae987b32a68126dd6dcf2488f
9 changes: 2 additions & 7 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ struct device {
struct kobject kobj;
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
struct device_type *type;
unsigned is_registered:1;
unsigned uevent_suppress:1;

struct semaphore sem; /* semaphore to synchronize calls to
Expand Down Expand Up @@ -509,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data)

static inline int device_is_registered(struct device *dev)
{
return dev->is_registered;
return dev->kobj.state_in_sysfs;
}

void driver_init(void);
Expand Down

0 comments on commit a1b5987

Please sign in to comment.