diff options
| author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
| commit | 4854c7b27f0975a2b629f35ea3996d2968eb7c4f (patch) | |
| tree | 4102bdb70289764a2058aff0f907b13d7cf0e0d1 /include/linux/sysdev.h | |
| parent | 3cbd5b32cb625f5c0f1b1476d154fac873dd49ce (diff) | |
| parent | fcc18e83e1f6fd9fa6b333735bf0fcd530655511 (diff) | |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/sysdev.h')
| -rw-r--r-- | include/linux/sysdev.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index 2a4b432e1176..166a2e58c287 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
| @@ -37,11 +37,27 @@ struct sysdev_class { | |||
| 37 | struct kset kset; | 37 | struct kset kset; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | struct sysdev_class_attribute { | ||
| 41 | struct attribute attr; | ||
| 42 | ssize_t (*show)(struct sysdev_class *, char *); | ||
| 43 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | ||
| 44 | }; | ||
| 45 | |||
| 46 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
| 47 | struct sysdev_class_attribute attr_##_name = { \ | ||
| 48 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
| 49 | .show = _show, \ | ||
| 50 | .store = _store, \ | ||
| 51 | }; | ||
| 52 | |||
| 40 | 53 | ||
| 41 | extern int sysdev_class_register(struct sysdev_class *); | 54 | extern int sysdev_class_register(struct sysdev_class *); |
| 42 | extern void sysdev_class_unregister(struct sysdev_class *); | 55 | extern void sysdev_class_unregister(struct sysdev_class *); |
| 43 | 56 | ||
| 44 | 57 | extern int sysdev_class_create_file(struct sysdev_class *, | |
| 58 | struct sysdev_class_attribute *); | ||
| 59 | extern void sysdev_class_remove_file(struct sysdev_class *, | ||
| 60 | struct sysdev_class_attribute *); | ||
| 45 | /** | 61 | /** |
| 46 | * Auxillary system device drivers. | 62 | * Auxillary system device drivers. |
| 47 | */ | 63 | */ |
