Skip to content

Commit 1abdf9e

Browse files
committed
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
1 parent d323436 commit 1abdf9e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/acpi/button.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,10 @@ static int acpi_button_probe(struct platform_device *pdev)
672672

673673
static void acpi_button_remove(struct platform_device *pdev)
674674
{
675-
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
676675
struct acpi_button *button = platform_get_drvdata(pdev);
676+
struct acpi_device *adev = button->adev;
677677

678-
switch (device->device_type) {
678+
switch (adev->device_type) {
679679
case ACPI_BUS_TYPE_POWER_BUTTON:
680680
acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
681681
acpi_button_event);
@@ -685,7 +685,7 @@ static void acpi_button_remove(struct platform_device *pdev)
685685
acpi_button_event);
686686
break;
687687
default:
688-
acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
688+
acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
689689
button->type == ACPI_BUTTON_TYPE_LID ?
690690
acpi_lid_notify :
691691
acpi_button_notify);

0 commit comments

Comments
 (0)