diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 08a02cdc737c..1fa97875259f 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1024,6 +1024,8 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze); #endif /* CONFIG_PM_SLEEP */ +static void acpi_dev_pm_detach(struct device *dev, bool power_off); + static struct dev_pm_domain acpi_general_pm_domain = { .ops = { .runtime_suspend = acpi_subsys_runtime_suspend, @@ -1040,6 +1042,7 @@ static struct dev_pm_domain acpi_general_pm_domain = { .restore_early = acpi_subsys_resume_early, #endif }, + .detach = acpi_dev_pm_detach }; /** @@ -1117,7 +1120,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) acpi_device_wakeup(adev, ACPI_STATE_S0, false); } - dev->pm_domain->detach = acpi_dev_pm_detach; return 0; } EXPORT_SYMBOL_GPL(acpi_dev_pm_attach); diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 8c5503c0bad7..9e094c5d6d5a 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -41,7 +41,6 @@ ACPI_MODULE_NAME("video"); void acpi_video_unregister_backlight(void); static bool backlight_notifier_registered; -static struct notifier_block backlight_nb; static struct work_struct backlight_notify_work; static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef; @@ -323,6 +322,10 @@ static int acpi_video_backlight_notify(struct notifier_block *nb, return NOTIFY_OK; } +static struct notifier_block backlight_nb = { + .notifier_call = acpi_video_backlight_notify, +}; + /* * Determine which type of backlight interface to use on this system, * First check cmdline, then dmi quirks, then do autodetect. @@ -353,8 +356,6 @@ enum acpi_backlight_type acpi_video_get_backlight_type(void) &video_caps, NULL); INIT_WORK(&backlight_notify_work, acpi_video_backlight_notify_work); - backlight_nb.notifier_call = acpi_video_backlight_notify; - backlight_nb.priority = 0; if (backlight_register_notifier(&backlight_nb) == 0) backlight_notifier_registered = true; init_done = true;