diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-07-31 20:48:04 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-07-31 20:48:04 -0700 |
| commit | 8d1290b87459b8fb52a9d9ed5f3c02e7c17aa03c (patch) | |
| tree | 98f6908c45d00be0cabe2c2827fe0e9a416c0163 /include/linux | |
| parent | 9c817b3927d174caee7ea6eeb8a30f2efdffe1fe (diff) | |
driverfs: Declare DEVICE_ATTR macro for initializing device attributes
(hide internal format of the structure)
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/driverfs_fs.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/driverfs_fs.h b/include/linux/driverfs_fs.h index dceb539d91dc..2bfeb8d4acde 100644 --- a/include/linux/driverfs_fs.h +++ b/include/linux/driverfs_fs.h @@ -37,11 +37,18 @@ struct device; struct device_attribute { char * name; mode_t mode; - ssize_t (*show)(struct device * dev, char * buf, size_t count, loff_t off); ssize_t (*store)(struct device * dev, const char * buf, size_t count, loff_t off); }; +#define DEVICE_ATTR(_name,_str,_mode,_show,_store) \ +struct device_attribute dev_attr_##_name = { \ + .name = _str, \ + .mode = _mode, \ + .show = _show, \ + .store = _store, \ +}; + extern int driverfs_create_dir(struct driver_dir_entry *, struct driver_dir_entry *); |
