ACPI / video: Fix initial level validity test
authorAaron Lu <aaron.lu@intel.com>
Wed, 6 Nov 2013 01:03:15 +0000 (09:03 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Nov 2013 01:14:48 +0000 (02:14 +0100)
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>
drivers/acpi/video.c

index 38c3a28d6392586d2123f5df44f226a2aa832829..bf521b36c2f94b6b3b9daa7f920ac7a87754ac5c 100644 (file)
@@ -856,7 +856,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 = max_level;