diff options
| author | 2010-03-19 08:05:10 +0100 | |
|---|---|---|
| committer | 2010-03-19 08:05:10 +0100 | |
| commit | b4b7a4ef097f288f724420b473dbf92a89c0ab7e (patch) | |
| tree | 23ad8101e3e77c32a8d1e1b95a9c1cd7f7a475b7 /include/linux/sysdev.h | |
| parent | cfq-iosched: fix a kbuild regression (diff) | |
| parent | Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 (diff) | |
| download | linux-dev-b4b7a4ef097f288f724420b473dbf92a89c0ab7e.tar.xz linux-dev-b4b7a4ef097f288f724420b473dbf92a89c0ab7e.zip | |
Merge branch 'master' into for-linus
Conflicts:
block/Kconfig
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/sysdev.h')
| -rw-r--r-- | include/linux/sysdev.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index f395bb3fa2f2..1154c29f4101 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h @@ -27,10 +27,12 @@ struct sys_device; +struct sysdev_class_attribute; struct sysdev_class { const char *name; struct list_head drivers; + struct sysdev_class_attribute **attrs; /* Default operations for these types of devices */ int (*shutdown)(struct sys_device *); @@ -41,8 +43,10 @@ struct sysdev_class { struct sysdev_class_attribute { struct attribute attr; - ssize_t (*show)(struct sysdev_class *, char *); - ssize_t (*store)(struct sysdev_class *, const char *, size_t); + ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *, + char *); + ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *, + const char *, size_t); }; #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ @@ -119,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; |
