ACPI / video: Fix initial level validity test
authorAaron Lu <aaron.lu@intel.com>
Wed, 6 Nov 2013 01:03:15 +0000 (09:03 +0800)
committerJiri Slaby <jslaby@suse.cz>
Fri, 6 Jun 2014 09:27:01 +0000 (11:27 +0200)
commit 9efa5e50598c5568b0678bb411b239a0b6e9a328 upstream.

When testing if the firmware's initial value is valid, we should use
the corrected level value instead of the raw value returned from
firmware.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/acpi/video.c

index 5708e44376fe486174d8e351a4e77c3d96c62d83..d2e069044a0f92ad7f2e3ab0676a1f8682bff722 100644 (file)
@@ -836,7 +836,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
                 * or an index). Set the backlight to max_level in this case.
                 */
                for (i = 2; i < br->count; i++)
-                       if (level_old == br->levels[i])
+                       if (level == br->levels[i])
                                break;
                if (i == br->count || !level)
                        level = max_level;