2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 17:23:55 +08:00

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>
This commit is contained in:
Rafael J. Wysocki 2021-08-25 20:31:10 +02:00
parent fad40a6248
commit 2bc4eb943b

View File

@ -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;