Commit b9b32597 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGuenter Roeck <linux@roeck-us.net>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ad81f054
...@@ -79,6 +79,8 @@ struct attribute_group { ...@@ -79,6 +79,8 @@ struct attribute_group {
.show = _name##_show, \ .show = _name##_show, \
} }
#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store)
#define __ATTR_NULL { .attr = { .name = NULL } } #define __ATTR_NULL { .attr = { .name = NULL } }
#ifdef CONFIG_DEBUG_LOCK_ALLOC #ifdef CONFIG_DEBUG_LOCK_ALLOC
......
...@@ -6234,8 +6234,6 @@ perf_event_mux_interval_ms_store(struct device *dev, ...@@ -6234,8 +6234,6 @@ perf_event_mux_interval_ms_store(struct device *dev,
return count; return count;
} }
#define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store)
static struct device_attribute pmu_dev_attrs[] = { static struct device_attribute pmu_dev_attrs[] = {
__ATTR_RO(type), __ATTR_RO(type),
__ATTR_RW(perf_event_mux_interval_ms), __ATTR_RW(perf_event_mux_interval_ms),
......
...@@ -232,8 +232,6 @@ static ssize_t stable_pages_required_show(struct device *dev, ...@@ -232,8 +232,6 @@ static ssize_t stable_pages_required_show(struct device *dev,
bdi_cap_stable_pages_required(bdi) ? 1 : 0); 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[] = { static struct device_attribute bdi_dev_attrs[] = {
__ATTR_RW(read_ahead_kb), __ATTR_RW(read_ahead_kb),
__ATTR_RW(min_ratio), __ATTR_RW(min_ratio),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment