From: Hans de Goede Date: Thu, 28 Apr 2022 12:45:35 +0000 (+0200) Subject: ACPI: video: Drop backlight_device_get_by_type() call from acpi_video_get_backlight_t... X-Git-Tag: v6.1-rc5~310^2~39^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2fc3c899bb091ec69cd74d4d69d71f8b2acdc11;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Hans de Goede --- diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 5f105ea..385eb49 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;