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 38c3a28..bf521b3 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;