summaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorDaniel Ritz2005-09-22 09:47:24 +0200
committerLinus Torvalds2005-09-22 16:58:24 +0200
commitd305ef5d2a4e77bfa66160513f4a7494126a506b (patch)
treef70f435571fb6c4d520fea0f3c769a2a6df73f84 /include/linux/device.h
parent[PATCH] Driver Core: fis bus rescan devices race (diff)
downloadkernel-qcow2-linux-d305ef5d2a4e77bfa66160513f4a7494126a506b.tar.gz
kernel-qcow2-linux-d305ef5d2a4e77bfa66160513f4a7494126a506b.tar.xz
kernel-qcow2-linux-d305ef5d2a4e77bfa66160513f4a7494126a506b.zip
[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>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 06e5d42f2c7b..95d607a48f06 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -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
*/