]> Git Repo - linux.git/commitdiff
sysdev: Add sysdev_create/remove_files
authorAndi Kleen <[email protected]>
Tue, 5 Jan 2010 11:48:05 +0000 (12:48 +0100)
committerGreg Kroah-Hartman <[email protected]>
Mon, 8 Mar 2010 01:04:47 +0000 (17:04 -0800)
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
include/linux/sysdev.h

index b6244f9b533fbb6415fe1d8101edaae58eba7d19..1154c29f41018561d1e6e1e58b238bc97c5e4b53 100644 (file)
@@ -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;
This page took 0.057035 seconds and 4 git commands to generate.