diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-02-12 14:33:00 +0100 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-02-13 14:24:50 +0100 |
| commit | 1abdf9e7967f154b3d4bfe0681dd38b8e036ee63 (patch) | |
| tree | fa99f5a902ff38785bd0a80fa841ee9c0d8cba5b | |
| parent | d323436b13f34b1df8261eb68989abda47e1785b (diff) | |
ACPI: button: Tweak acpi_button_remove()
Modify acpi_button_remove() to get the ACPI device object pointer
from button->adev instead of retrieving it with the help of the
ACPI_COMPANION() macro to reduce overhead slightly.
While at it, rename the struct acpi_device pointer variable in
acpi_button_remove() to adev.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/13948466.uLZWGnKmhe@rafael.j.wysocki
| -rw-r--r-- | drivers/acpi/button.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 17d56f01e40a..7a06194d078b 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -672,10 +672,10 @@ err_free_button: static void acpi_button_remove(struct platform_device *pdev) { - struct acpi_device *device = ACPI_COMPANION(&pdev->dev); struct acpi_button *button = platform_get_drvdata(pdev); + struct acpi_device *adev = button->adev; - switch (device->device_type) { + switch (adev->device_type) { case ACPI_BUS_TYPE_POWER_BUTTON: acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, acpi_button_event); @@ -685,7 +685,7 @@ static void acpi_button_remove(struct platform_device *pdev) acpi_button_event); break; default: - acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, + acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, button->type == ACPI_BUTTON_TYPE_LID ? acpi_lid_notify : acpi_button_notify); |
