Skip to content

Commit a497538

Browse files
committed
ACPI: thermal: Adjust event notification routine
Adjust acpi_thermal_notify() to cast its "data" argument to a struct acpi_thermal pointer istead of a struct acpi_device one, which allows the use of acpi_driver_data() to be limited and will facilitate subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: lihuisong@huawei.com Link: https://patch.msgid.link/5035876.GXAFRqVoOG@rafael.j.wysocki
1 parent d27ccae commit a497538

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/acpi/thermal.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,7 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
670670

671671
static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
672672
{
673-
struct acpi_device *device = data;
674-
struct acpi_thermal *tz = acpi_driver_data(device);
673+
struct acpi_thermal *tz = data;
675674

676675
if (!tz)
677676
return;
@@ -685,8 +684,8 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
685684
acpi_thermal_trips_update(tz, event);
686685
break;
687686
default:
688-
acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n",
689-
event);
687+
acpi_handle_debug(tz->device->handle,
688+
"Unsupported event [0x%x]\n", event);
690689
break;
691690
}
692691
}
@@ -881,7 +880,7 @@ static int acpi_thermal_add(struct acpi_device *device)
881880
acpi_device_bid(device), deci_kelvin_to_celsius(tz->temp_dk));
882881

883882
result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
884-
acpi_thermal_notify, device);
883+
acpi_thermal_notify, tz);
885884
if (result)
886885
goto flush_wq;
887886

0 commit comments

Comments
 (0)