diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-04-29 14:29:31 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-09-02 10:57:14 +0300 |
commit | 038a8191ae7a636586a4415b001cece831ab7019 (patch) | |
tree | aefa786e7ab1771876258816d0e1c2db60c050ae /drivers/acpi | |
parent | c1af8bec569dd6b8d874c14455ab02398c3d34cd (diff) | |
download | linux-038a8191ae7a636586a4415b001cece831ab7019.tar.xz |
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 <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_video.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index cde8ffa9f0b8..8545bf94866f 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) |