summaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorMark McLoughlin2008-12-15 13:58:26 +0100
committerGreg Kroah-Hartman2009-01-06 19:44:33 +0100
commit0aa0dc41bfd993491c2344870eee7a3b218551fb (patch)
treebf0896c7e0bb9f5b7e6253fc15c8846b6f188d08 /include/linux/device.h
parentdriver core:fix duplicate removing driver link in __device_release_driver (diff)
downloadkernel-qcow2-linux-0aa0dc41bfd993491c2344870eee7a3b218551fb.tar.gz
kernel-qcow2-linux-0aa0dc41bfd993491c2344870eee7a3b218551fb.tar.xz
kernel-qcow2-linux-0aa0dc41bfd993491c2344870eee7a3b218551fb.zip
driver core: add root_device_register()
Add support for allocating root device objects which group device objects under /sys/devices directories. Also add a sysfs 'module' symlink which points to the owner of the root device object. This symlink will be used in virtio to allow userspace to determine which virtio bus implementation a given device is associated with. [Includes suggestions from Cornelia Huck] Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index b97a0cf1eb05..7d9da4b4993f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -483,6 +483,17 @@ extern int device_rename(struct device *dev, char *new_name);
extern int device_move(struct device *dev, struct device *new_parent);
/*
+ * Root device objects for grouping under /sys/devices
+ */
+extern struct device *__root_device_register(const char *name,
+ struct module *owner);
+static inline struct device *root_device_register(const char *name)
+{
+ return __root_device_register(name, THIS_MODULE);
+}
+extern void root_device_unregister(struct device *root);
+
+/*
* Manual binding of a device to driver. See drivers/base/bus.c
* for information on use.
*/