]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Introduce _SYSDEV_ATTR
authorOlof Johansson <olof@lixom.net>
Mon, 29 Jan 2007 03:24:57 +0000 (21:24 -0600)
committerPaul Mackerras <paulus@samba.org>
Wed, 7 Feb 2007 03:03:19 +0000 (14:03 +1100)
Introduce _SYSDEV_ATTR(), to be used to just define the struct, and not a
named variable with the attribute. Useful for arrays of sysdev_attributes.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/linux/sysdev.h

index 166a2e58c2871da6dc0de55a3498ae075f869b65..389ccf858d378013f7cc86f94e51db5df46f9991 100644 (file)
@@ -98,12 +98,16 @@ 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,    \
+                .owner = THIS_MODULE },                        \
        .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 *);