diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index a094763113bc..8fbad8bc4650 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1271,13 +1271,9 @@ fail: static void acpi_battery_remove(struct platform_device *pdev) { - struct acpi_device *device = ACPI_COMPANION(&pdev->dev); struct acpi_battery *battery = platform_get_drvdata(pdev); - if (!device || !battery) - return; - - acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY, + acpi_dev_remove_notify_handler(battery->device, ACPI_ALL_NOTIFY, acpi_battery_notify); device_init_wakeup(&pdev->dev, false);