diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-09-18 23:16:20 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-21 23:58:37 +0200 |
commit | 681eaefd53a809e6e7a407aec789b22f767f299e (patch) | |
tree | 2b8e676b2ce49d614041c7826e452ac4c38cceba | |
parent | 8ea0797f0f768945e323a342c60e79ab3d9ec6f5 (diff) |
backports: add DEVICE_ATTR_RW
This is used by drivers/media/v4l2-core/v4l2-dev.c.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/device.h | 2 | ||||
-rw-r--r-- | backport/backport-include/linux/sysfs.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index 8f080cc9..2244c626 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -192,6 +192,8 @@ backport_device_release_driver(struct device *dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) #define DEVICE_ATTR_RO(_name) \ struct device_attribute dev_attr_ ## _name = __ATTR_RO(_name); +#define DEVICE_ATTR_RW(_name) \ +struct device_attribute dev_attr_ ## _name = __ATTR_RW(_name) #define ATTRIBUTE_GROUPS(_name) \ static struct BP_ATTR_GRP_STRUCT _name##_dev_attrs[ARRAY_SIZE(_name##_attrs)];\ diff --git a/backport/backport-include/linux/sysfs.h b/backport/backport-include/linux/sysfs.h index a2ef73f1..13bab43a 100644 --- a/backport/backport-include/linux/sysfs.h +++ b/backport/backport-include/linux/sysfs.h @@ -31,4 +31,9 @@ do { \ #endif #endif +#ifndef __ATTR_RW +#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ + _name##_show, _name##_store) +#endif + #endif /* __BACKPORT_LINUX_SYSFS_H */ |