summaryrefslogtreecommitdiffstats
path: root/include/linux/sysdev.h
diff options
context:
space:
mode:
authorOlof Johansson2007-01-29 04:24:57 +0100
committerPaul Mackerras2007-02-07 04:03:19 +0100
commit7583b6e424ebaa278342f6a8c2a61211af56dad1 (patch)
tree8800b0ea9e1f90303f9a592eb4ffab3e9bd27d27 /include/linux/sysdev.h
parent[POWERPC] Add PMC type to cputable (diff)
downloadkernel-qcow2-linux-7583b6e424ebaa278342f6a8c2a61211af56dad1.tar.gz
kernel-qcow2-linux-7583b6e424ebaa278342f6a8c2a61211af56dad1.tar.xz
kernel-qcow2-linux-7583b6e424ebaa278342f6a8c2a61211af56dad1.zip
[POWERPC] Introduce _SYSDEV_ATTR
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>
Diffstat (limited to 'include/linux/sysdev.h')
-rw-r--r--include/linux/sysdev.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 166a2e58c287..389ccf858d37 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -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 *);