forked from Minki/linux
ACPI: video: improve PM notifer callback
PM notifier callbacks should check for supported events rather than filter out the unsupported events. So that it won't break when a new event is introduced. No functional change in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
42226c9897
commit
1934fee675
@ -1707,12 +1707,9 @@ static int acpi_video_resume(struct notifier_block *nb,
|
||||
int i;
|
||||
|
||||
switch (val) {
|
||||
case PM_HIBERNATION_PREPARE:
|
||||
case PM_SUSPEND_PREPARE:
|
||||
case PM_RESTORE_PREPARE:
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
case PM_POST_HIBERNATION:
|
||||
case PM_POST_SUSPEND:
|
||||
case PM_POST_RESTORE:
|
||||
video = container_of(nb, struct acpi_video_bus, pm_nb);
|
||||
|
||||
dev_info(&video->device->dev, "Restoring backlight state\n");
|
||||
@ -1726,6 +1723,8 @@ static int acpi_video_resume(struct notifier_block *nb,
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static acpi_status
|
||||
acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
|
||||
|
Loading…
Reference in New Issue
Block a user