summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-08-25 20:31:10 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-08-27 21:08:15 +0200
commit2bc4eb943b1b27606cd6d63be69f2197cad15173 (patch)
tree85699dc95e590c2bb06f5c2cf7055d60c93a379c /drivers/acpi/power.c
parentACPI: power: Use acpi_handle_debug() to print debug messages (diff)
downloadlinux-2bc4eb943b1b27606cd6d63be69f2197cad15173.tar.xz
linux-2bc4eb943b1b27606cd6d63be69f2197cad15173.zip
ACPI: power: Drop name from struct acpi_power_resource
Drop the name field (that only is used in diagnostic messages) from struct acpi_power_resource and use the name of the power resource device object instead of it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 21d42804b2c1..b9863e22b952 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -48,7 +48,6 @@ struct acpi_power_dependent_device {
struct acpi_power_resource {
struct acpi_device device;
struct list_head list_node;
- char *name;
u32 system_level;
u32 order;
unsigned int ref_count;
@@ -70,6 +69,11 @@ static DEFINE_MUTEX(power_resource_list_lock);
Power Resource Management
-------------------------------------------------------------------------- */
+static inline const char *resource_dev_name(struct acpi_power_resource *pr)
+{
+ return dev_name(&pr->device.dev);
+}
+
static inline
struct acpi_power_resource *to_power_resource(struct acpi_device *device)
{
@@ -264,7 +268,8 @@ acpi_power_resource_add_dependent(struct acpi_power_resource *resource,
dep->dev = dev;
list_add_tail(&dep->node, &resource->dependents);
- dev_dbg(dev, "added power dependency to [%s]\n", resource->name);
+ dev_dbg(dev, "added power dependency to [%s]\n",
+ resource_dev_name(resource));
unlock:
mutex_unlock(&resource->resource_lock);
@@ -283,7 +288,7 @@ acpi_power_resource_remove_dependent(struct acpi_power_resource *resource,
list_del(&dep->node);
kfree(dep);
dev_dbg(dev, "removed power dependency to [%s]\n",
- resource->name);
+ resource_dev_name(resource));
break;
}
}
@@ -381,7 +386,7 @@ static int __acpi_power_on(struct acpi_power_resource *resource)
list_for_each_entry(dep, &resource->dependents, node) {
dev_dbg(dep->dev, "runtime resuming because [%s] turned on\n",
- resource->name);
+ resource_dev_name(resource));
pm_request_resume(dep->dev);
}
@@ -953,7 +958,6 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
mutex_init(&resource->resource_lock);
INIT_LIST_HEAD(&resource->list_node);
INIT_LIST_HEAD(&resource->dependents);
- resource->name = device->pnp.bus_id;
strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
device->power.state = ACPI_STATE_UNKNOWN;