From: Hans de Goede Date: Fri, 29 Apr 2022 11:29:31 +0000 (+0200) Subject: ACPI: video: Simplify acpi_video_unregister_backlight() X-Git-Tag: v6.1-rc5~310^2~39^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=038a8191ae7a636586a4415b001cece831ab7019;p=platform%2Fkernel%2Flinux-starfive.git ACPI: video: Simplify acpi_video_unregister_backlight() When acpi_video_register() has not run yet the video_bus_head will be empty, so there is no need to check the register_count flag first. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede --- diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index cde8ffa..8545bf9 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -2257,14 +2257,10 @@ void acpi_video_unregister_backlight(void) { struct acpi_video_bus *video; - mutex_lock(®ister_count_mutex); - if (register_count) { - mutex_lock(&video_list_lock); - list_for_each_entry(video, &video_bus_head, entry) - acpi_video_bus_unregister_backlight(video); - mutex_unlock(&video_list_lock); - } - mutex_unlock(®ister_count_mutex); + mutex_lock(&video_list_lock); + list_for_each_entry(video, &video_bus_head, entry) + acpi_video_bus_unregister_backlight(video); + mutex_unlock(&video_list_lock); } bool acpi_video_handles_brightness_key_presses(void)