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>
This commit is contained in:
@@ -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
|
||||
@@ -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);
|
||||
|
Reference in New Issue
Block a user