summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-08-04 12:55:34 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 09:50:48 -0700
commit4622709445705c1e423d2addcfd8ccae052fe0ba (patch)
treec9032374e8f99a5bb9b8b8e012e0a6de4c9c3846 /include/linux
parentccb86a6907c9ba7b5be5f521362fc308e80bed34 (diff)
downloadlinux-4622709445705c1e423d2addcfd8ccae052fe0ba.tar.gz
linux-4622709445705c1e423d2addcfd8ccae052fe0ba.tar.bz2
linux-4622709445705c1e423d2addcfd8ccae052fe0ba.zip
Driver core: Add support for compatibility classes
When turning class devices into bus devices, we may need to temporarily add links in sysfs so that user-space applications are not confused. This is done by adding the following API: * Functions to register and unregister compatibility classes. These appear in sysfs at the same location as regular classes, but instead of class devices, they contain links to bus devices. * Functions to create and delete such links. Additionally, the caller can optionally pass a target device to which a "device" link should point (typically that would be the device's parent), to fully emulate the original class device. The i2c subsystem will be the first user of this API, as i2c adapters are being converted from class devices to bus devices. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index e19e40a3dcbe..62ff53a67931 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -225,6 +225,14 @@ extern void class_unregister(struct class *class);
__class_register(class, &__key); \
})
+struct class_compat;
+struct class_compat *class_compat_register(const char *name);
+void class_compat_unregister(struct class_compat *cls);
+int class_compat_create_link(struct class_compat *cls, struct device *dev,
+ struct device *device_link);
+void class_compat_remove_link(struct class_compat *cls, struct device *dev,
+ struct device *device_link);
+
extern void class_dev_iter_init(struct class_dev_iter *iter,
struct class *class,
struct device *start,