diff options
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 *); |
