diff options
author | Joe Perches <joe@perches.com> | 2017-12-19 21:15:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 18:34:34 +0300 |
commit | c828a8920307185b7194b575731e8387c99a5a67 (patch) | |
tree | ba6d8d4416693df1b322938fbb3eaceea1322df9 /arch/tile | |
parent | b6b996b6cdeecf7e1646c87422e04e446ddce124 (diff) | |
download | linux-c828a8920307185b7194b575731e8387c99a5a67.tar.xz |
treewide: Use DEVICE_ATTR_RO
Convert DEVICE_ATTR uses to DEVICE_ATTR_RO where possible.
Done with perl script:
$ git grep -w --name-only DEVICE_ATTR | \
xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IRUGO\s*|\s*0444\s*)\)?\s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g; print;}'
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/kernel/sysfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c index af5024f0fb5a..b09456a3d77a 100644 --- a/arch/tile/kernel/sysfs.c +++ b/arch/tile/kernel/sysfs.c @@ -38,7 +38,7 @@ static ssize_t chip_width_show(struct device *dev, { return sprintf(page, "%u\n", smp_width); } -static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL); +static DEVICE_ATTR_RO(chip_width); static ssize_t chip_height_show(struct device *dev, struct device_attribute *attr, @@ -46,7 +46,7 @@ static ssize_t chip_height_show(struct device *dev, { return sprintf(page, "%u\n", smp_height); } -static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL); +static DEVICE_ATTR_RO(chip_height); static ssize_t chip_serial_show(struct device *dev, struct device_attribute *attr, @@ -54,7 +54,7 @@ static ssize_t chip_serial_show(struct device *dev, { return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); } -static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL); +static DEVICE_ATTR_RO(chip_serial); static ssize_t chip_revision_show(struct device *dev, struct device_attribute *attr, @@ -62,7 +62,7 @@ static ssize_t chip_revision_show(struct device *dev, { return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); } -static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL); +static DEVICE_ATTR_RO(chip_revision); static ssize_t type_show(struct device *dev, @@ -71,7 +71,7 @@ static ssize_t type_show(struct device *dev, { return sprintf(page, "tilera\n"); } -static DEVICE_ATTR(type, 0444, type_show, NULL); +static DEVICE_ATTR_RO(type); #define HV_CONF_ATTR(name, conf) \ static ssize_t name ## _show(struct device *dev, \ |