diff options
author | Zhang Rui <rui.zhang@intel.com> | 2009-04-13 23:02:18 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-20 00:22:44 -0400 |
commit | 90af2cf6205bfc8def8c5a64c9134031d60b10fb (patch) | |
tree | 0561387d1104c8ba5d16c4b248541df3f24dea97 /drivers/acpi | |
parent | d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a (diff) |
ACPI video: fix an error when the brightness levels on AC and on Battery are same
when the brightness level on AC and brightness level on Battery
are same, the level_ac_battery is 1 in the current code,
which is wrong.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/video.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index cd4fb7543a90..21968ae6ed91 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -770,10 +770,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
770 | * In this case, the first two elements in _BCL packages | 770 | * In this case, the first two elements in _BCL packages |
771 | * are also supported brightness levels that OS should take care of. | 771 | * are also supported brightness levels that OS should take care of. |
772 | */ | 772 | */ |
773 | for (i = 2; i < count; i++) | 773 | for (i = 2; i < count; i++) { |
774 | if (br->levels[i] == br->levels[0] || | 774 | if (br->levels[i] == br->levels[0]) |
775 | br->levels[i] == br->levels[1]) | ||
776 | level_ac_battery++; | 775 | level_ac_battery++; |
776 | if (br->levels[i] == br->levels[1]) | ||
777 | level_ac_battery++; | ||
778 | } | ||
777 | 779 | ||
778 | if (level_ac_battery < 2) { | 780 | if (level_ac_battery < 2) { |
779 | level_ac_battery = 2 - level_ac_battery; | 781 | level_ac_battery = 2 - level_ac_battery; |