diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-01-15 10:45:17 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:46:16 +0900 |
commit | 13e1e5f0617a18597faeb35dab70343d551831cb (patch) | |
tree | 1374f3eece5945bf2b8f2706d4d1aabb9e08670f | |
parent | 1dfaeb24a3cff3b3f638ab5d34a99d20766157ec (diff) | |
download | linux-3.10-13e1e5f0617a18597faeb35dab70343d551831cb.tar.gz linux-3.10-13e1e5f0617a18597faeb35dab70343d551831cb.tar.bz2 linux-3.10-13e1e5f0617a18597faeb35dab70343d551831cb.zip |
sysfs.h: add __ATTR_RW() macro
A number of parts of the kernel created their own version of this, might
as well have the sysfs core provide it instead.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mainline backport]
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
-rw-r--r-- | include/linux/sysfs.h | 2 | ||||
-rw-r--r-- | mm/backing-dev.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index e2cee22f578..9cd20c8404e 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -79,6 +79,8 @@ struct attribute_group { .show = _name##_show, \ } +#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store) + #define __ATTR_NULL { .attr = { .name = NULL } } #ifdef CONFIG_DEBUG_LOCK_ALLOC diff --git a/mm/backing-dev.c b/mm/backing-dev.c index eea1a9dfac3..2e53312b890 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -232,8 +232,6 @@ static ssize_t stable_pages_required_show(struct device *dev, bdi_cap_stable_pages_required(bdi) ? 1 : 0); } -#define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store) - static struct device_attribute bdi_dev_attrs[] = { __ATTR_RW(read_ahead_kb), __ATTR_RW(min_ratio), |