summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-04-28 15:45:35 +0300
committerHans de Goede <hdegoede@redhat.com>2022-09-02 10:57:14 +0300
commita2fc3c899bb091ec69cd74d4d69d71f8b2acdc11 (patch)
tree55b6df90780a20917134e0001de0873622940dc2 /drivers
parent7f908d332dc48a12436725ae326d6143a1a02c1c (diff)
downloadlinux-a2fc3c899bb091ec69cd74d4d69d71f8b2acdc11.tar.xz
ACPI: video: Drop backlight_device_get_by_type() call from acpi_video_get_backlight_type()
All x86/ACPI kms drivers which register native/BACKLIGHT_RAW type backlight devices call acpi_video_backlight_use_native() now. This sets __acpi_video_get_backlight_type()'s internal static native_available flag. This makes the backlight_device_get_by_type(BACKLIGHT_RAW) check unnecessary. Relying on the cached native_available value not only is simpler, it will also work correctly in cases where then native backlight registration was skipped because of acpi_video_backlight_use_native() returning false. Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/video_detect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 5f105eaa7d30..385eb49c763f 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -608,8 +608,7 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
if (!(video_caps & ACPI_VIDEO_BACKLIGHT))
return acpi_backlight_vendor;
- if (acpi_osi_is_win8() &&
- (native_available || backlight_device_get_by_type(BACKLIGHT_RAW)))
+ if (acpi_osi_is_win8() && native_available)
return acpi_backlight_native;
return acpi_backlight_video;