From c828a8920307185b7194b575731e8387c99a5a67 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 19 Dec 2017 10:15:08 -0800 Subject: 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 Acked-by: Rafael J. Wysocki Acked-by: Robert Jarzmik Acked-by: Sagi Grimberg Acked-by: Zhang Rui Acked-by: Harald Freudenberger Acked-by: Jani Nikula Acked-by: Corey Minyard Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/device_sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index a041689e5701..545e91420cde 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -357,7 +357,7 @@ static ssize_t real_power_state_show(struct device *dev, return sprintf(buf, "%s\n", acpi_power_state_string(state)); } -static DEVICE_ATTR(real_power_state, 0444, real_power_state_show, NULL); +static DEVICE_ATTR_RO(real_power_state); static ssize_t power_state_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -367,7 +367,7 @@ static ssize_t power_state_show(struct device *dev, return sprintf(buf, "%s\n", acpi_power_state_string(adev->power.state)); } -static DEVICE_ATTR(power_state, 0444, power_state_show, NULL); +static DEVICE_ATTR_RO(power_state); static ssize_t acpi_eject_store(struct device *d, struct device_attribute *attr, @@ -462,7 +462,7 @@ static ssize_t description_show(struct device *dev, return result; } -static DEVICE_ATTR(description, 0444, description_show, NULL); +static DEVICE_ATTR_RO(description); static ssize_t acpi_device_sun_show(struct device *dev, struct device_attribute *attr, -- cgit v1.2.3