[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
@@ -987,7 +987,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
|
||||
|
||||
/* remove this interface if it has been registered */
|
||||
interface = dev->actconfig->interface[i];
|
||||
if (!klist_node_attached(&interface->dev.knode_bus))
|
||||
if (!device_is_registered(&interface->dev))
|
||||
continue;
|
||||
dev_dbg (&dev->dev, "unregistering interface %s\n",
|
||||
interface->dev.bus_id);
|
||||
|
Reference in New Issue
Block a user