diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-08-08 22:15:15 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-08-09 10:53:06 +0200 |
commit | 868a4715a88114e914144fe07a630cd7230ab848 (patch) | |
tree | 0682342fb69c2198fb2b63248f1b45c4040d1c1a /drivers/acpi/thermal.c | |
parent | dabc621a311007d78bfcf60f8125c5e8c33ded7b (diff) | |
download | linux-stable-868a4715a88114e914144fe07a630cd7230ab848.tar.gz linux-stable-868a4715a88114e914144fe07a630cd7230ab848.tar.bz2 linux-stable-868a4715a88114e914144fe07a630cd7230ab848.zip |
ACPI: thermal: Do not attach private data to ACPI handles
The ACPI thermal driver uses acpi_bus_attach_private_data() to attach
the thermal zone object to the ACPI handle of the thermal zone and
acpi_bus_detach_private_data() to clean that up, but it never uses
acpi_bus_get_private_data() to retrieve that object.
Drop the unneded acpi_bus_attach_private_data() and
acpi_bus_detach_private_data() calls from the ACPI thermal driver and
clean up the related code.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 3aab121cd410..a329b0dce78f 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -742,7 +742,6 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) { int trips = 0; int result; - acpi_status status; int i; if (tz->trips.critical.valid) @@ -775,24 +774,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) if (result) goto unregister_tzd; - status = acpi_bus_attach_private_data(tz->device->handle, - tz->thermal_zone); - if (ACPI_FAILURE(status)) { - result = -ENODEV; - goto remove_links; - } - result = thermal_zone_device_enable(tz->thermal_zone); if (result) - goto acpi_bus_detach; + goto remove_links; dev_info(&tz->device->dev, "registered as thermal_zone%d\n", thermal_zone_device_id(tz->thermal_zone)); return 0; -acpi_bus_detach: - acpi_bus_detach_private_data(tz->device->handle); remove_links: acpi_thermal_zone_sysfs_remove(tz); unregister_tzd: @@ -806,7 +796,6 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) acpi_thermal_zone_sysfs_remove(tz); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone = NULL; - acpi_bus_detach_private_data(tz->device->handle); } |