Skip to content

Commit 038a819

Browse files
committed
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 <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent c1af8be commit 038a819

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/acpi/acpi_video.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,14 +2257,10 @@ void acpi_video_unregister_backlight(void)
22572257
{
22582258
struct acpi_video_bus *video;
22592259

2260-
mutex_lock(&register_count_mutex);
2261-
if (register_count) {
2262-
mutex_lock(&video_list_lock);
2263-
list_for_each_entry(video, &video_bus_head, entry)
2264-
acpi_video_bus_unregister_backlight(video);
2265-
mutex_unlock(&video_list_lock);
2266-
}
2267-
mutex_unlock(&register_count_mutex);
2260+
mutex_lock(&video_list_lock);
2261+
list_for_each_entry(video, &video_bus_head, entry)
2262+
acpi_video_bus_unregister_backlight(video);
2263+
mutex_unlock(&video_list_lock);
22682264
}
22692265

22702266
bool acpi_video_handles_brightness_key_presses(void)

0 commit comments

Comments
 (0)