]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sysfs.h: add __ATTR_RW() macro
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2013 23:05:51 +0000 (16:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Jul 2013 17:57:36 +0000 (10:57 -0700)
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>
include/linux/sysfs.h
kernel/events/core.c
mm/backing-dev.c

index e2cee22f578a6b24d7eb39c1ad298f15115bcb2d..9cd20c8404e5396c9b118c557b21e786b58dbc39 100644 (file)
@@ -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
index eba8fb5834ae2e7d527693d7eff63556a987bd9a..dd9878029d1f5e97c5e04f55b6e018830642f6f7 100644 (file)
@@ -6234,8 +6234,6 @@ perf_event_mux_interval_ms_store(struct device *dev,
        return count;
 }
 
-#define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store)
-
 static struct device_attribute pmu_dev_attrs[] = {
        __ATTR_RO(type),
        __ATTR_RW(perf_event_mux_interval_ms),
index d014ee5fcbbd2fa8004ae642f83571ddd949a5e6..e04454cdb33f4d58809c36b0212aa0ad74c1e22c 100644 (file)
@@ -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),