Skip to content

Commit

Permalink
sysdev: Add sysdev_create/remove_files
Browse files Browse the repository at this point in the history
Allow to create/remove arrays of sysdev attributes

Just wrappers around sysfs_create/move_files

Will be used later to clean up some drivers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Andi Kleen authored and Greg Kroah-Hartman committed Mar 8, 2010
1 parent 3701cde commit 1e395ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/linux/sysdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ struct sysdev_attribute {
extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);

/* Create/remove NULL terminated attribute list */
static inline int
sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)
{
return sysfs_create_files(&d->kobj, (const struct attribute **)a);
}

static inline void
sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a)
{
return sysfs_remove_files(&d->kobj, (const struct attribute **)a);
}

struct sysdev_ext_attribute {
struct sysdev_attribute attr;
void *var;
Expand Down

0 comments on commit 1e395ab

Please sign in to comment.