[PATCH] driver core: add helper device_is_registered()
add the helper and use it instead of open coding the klist_node_attached() check (which is a layering violation IMHO) idea by Alan Stern. Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
4c898c7f2f
commit
d305ef5d2a
@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data)
|
||||
dev->driver_data = data;
|
||||
}
|
||||
|
||||
static inline int device_is_registered(struct device *dev)
|
||||
{
|
||||
return klist_node_attached(&dev->knode_bus);
|
||||
}
|
||||
|
||||
/*
|
||||
* High level routines for use by the bus drivers
|
||||
*/
|
||||
|
Reference in New Issue
Block a user