From: Olof Johansson Date: Mon, 29 Jan 2007 03:24:57 +0000 (-0600) Subject: [POWERPC] Introduce _SYSDEV_ATTR X-Git-Tag: firefly_0821_release~30992^2~3^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7583b6e424ebaa278342f6a8c2a61211af56dad1;p=firefly-linux-kernel-4.4.55.git [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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Paul Mackerras --- 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 *);