Skip to content

Commit 868a471

Browse files
committed
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>
1 parent dabc621 commit 868a471

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

drivers/acpi/thermal.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
742742
{
743743
int trips = 0;
744744
int result;
745-
acpi_status status;
746745
int i;
747746

748747
if (tz->trips.critical.valid)
@@ -775,24 +774,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
775774
if (result)
776775
goto unregister_tzd;
777776

778-
status = acpi_bus_attach_private_data(tz->device->handle,
779-
tz->thermal_zone);
780-
if (ACPI_FAILURE(status)) {
781-
result = -ENODEV;
782-
goto remove_links;
783-
}
784-
785777
result = thermal_zone_device_enable(tz->thermal_zone);
786778
if (result)
787-
goto acpi_bus_detach;
779+
goto remove_links;
788780

789781
dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
790782
thermal_zone_device_id(tz->thermal_zone));
791783

792784
return 0;
793785

794-
acpi_bus_detach:
795-
acpi_bus_detach_private_data(tz->device->handle);
796786
remove_links:
797787
acpi_thermal_zone_sysfs_remove(tz);
798788
unregister_tzd:
@@ -806,7 +796,6 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
806796
acpi_thermal_zone_sysfs_remove(tz);
807797
thermal_zone_device_unregister(tz->thermal_zone);
808798
tz->thermal_zone = NULL;
809-
acpi_bus_detach_private_data(tz->device->handle);
810799
}
811800

812801

0 commit comments

Comments
 (0)