summaryrefslogtreecommitdiff
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorDwaipayan Ray <dwaipayanray1@gmail.com>2020-12-17 18:15:36 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-22 16:17:19 +0100
commit0f39ee8324e75c9d370e84a61323ceb194641a18 (patch)
tree2b59738a9162330a90e3cacefd3ef6583931d6e0 /drivers/acpi/power.c
parent19c329f6808995b142b3966301f217c831e7cf31 (diff)
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
Instead of open coding DEVICE_ATTR(), use the DEVICE_ATTR_RW(), DEVICE_ATTR_RO() and DEVICE_ATTR_WO() macros wherever possible. This required a few functions to be renamed but the functionality itself is unchanged. Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 189a0d4c6d06..3a7d0d703059 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -886,15 +886,16 @@ static void acpi_release_power_resource(struct device *dev)
kfree(resource);
}
-static ssize_t acpi_power_in_use_show(struct device *dev,
- struct device_attribute *attr,
- char *buf) {
+static ssize_t resource_in_use_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
struct acpi_power_resource *resource;
resource = to_power_resource(to_acpi_device(dev));
return sprintf(buf, "%u\n", !!resource->ref_count);
}
-static DEVICE_ATTR(resource_in_use, 0444, acpi_power_in_use_show, NULL);
+static DEVICE_ATTR_RO(resource_in_use);
static void acpi_power_sysfs_remove(struct acpi_device *device)
{