]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/sysdev.h
Driver core: change sysdev classes to use dynamic kobject names
[linux-2.6-omap-h63xx.git] / include / linux / sysdev.h
index 166a2e58c2871da6dc0de55a3498ae075f869b65..f752e73bf977e98381b95070096522c84e2ed5a1 100644 (file)
 #define _SYSDEV_H_
 
 #include <linux/kobject.h>
+#include <linux/module.h>
 #include <linux/pm.h>
 
 
 struct sys_device;
 
 struct sysdev_class {
+       const char *name;
        struct list_head        drivers;
 
        /* Default operations for these types of devices */
@@ -98,12 +100,15 @@ struct sysdev_attribute {
 };
 
 
-#define SYSDEV_ATTR(_name,_mode,_show,_store)          \
-struct sysdev_attribute attr_##_name = {                       \
-       .attr = {.name = __stringify(_name), .mode = _mode },   \
+#define _SYSDEV_ATTR(_name,_mode,_show,_store)                 \
+{                                                              \
+       .attr = { .name = __stringify(_name), .mode = _mode },  \
        .show   = _show,                                        \
        .store  = _store,                                       \
-};
+}
+
+#define SYSDEV_ATTR(_name,_mode,_show,_store)          \
+struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store);
 
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);