ACPI: video: Simplify __acpi_video_get_backlight_type()
authorHans de Goede <hdegoede@redhat.com>
Mon, 14 Nov 2022 14:44:58 +0000 (15:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:42 +0000 (11:11 +0100)
commit923c1922bdbe44bdbebe57b5b976d40f68853653
tree0189572a2feac168d338054bc5b0a168b637f303
parent33c25c3146837f2ac7e465fdfd5dedd85d202ca8
ACPI: video: Simplify __acpi_video_get_backlight_type()

[ Upstream commit a5df42521f328b45c9d89c13740e747be08ac66e ]

Simplify __acpi_video_get_backlight_type() removing a nested if which
makes the flow harder to follow.

This also results in having only 1 exit point with
return acpi_backlight_native instead of 2.

Note this drops the (video_caps & ACPI_VIDEO_BACKLIGHT) check from
the if (acpi_osi_is_win8() && native_available) return native path.
Windows 8's hardware certification requirements include that there must
be ACPI video bus backlight control, so the ACPI_VIDEO_BACKLIGHT check
is redundant.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/video_detect.c