Skip to content

Commit

Permalink
[POWERPC] Introduce _SYSDEV_ATTR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Olof Johansson authored and Paul Mackerras committed Feb 7, 2007
1 parent 1bd2e5a commit 7583b6e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/linux/sysdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit 7583b6e

Please sign in to comment.