Prev: [PATCH 20/62] Driver-Core: disable /sbin/hotplug by default
Next: [PATCH 10/62] sysdev: Convert node driver
From: Greg Kroah-Hartman on 2 Mar 2010 19:00 From: Andi Kleen <andi(a)firstfloor.org> 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(a)linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- include/linux/sysdev.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index b6244f9..1154c29 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h @@ -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; -- 1.7.0.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |