diff options
author | Pekka Paalanen <pq@iki.fi> | 2012-01-22 09:33:46 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-08 17:14:13 -0500 |
commit | 635032cb397b396241372fa0ff36ae758e658b23 (patch) | |
tree | 923c967080dc10b43b94c09fae3581dd96739bba /drivers/staging | |
parent | 3c1b86f17068cf6476fb2d022b9c8b44dedea2e5 (diff) |
Staging: asus_oled: fix image processing
Programming an image was broken, because odev->buf_offs was not advanced
for val == 0 in append_values(). This regression was introduced in:
commit 1ff12a4aa354bed093a0240d5e6347b1e27601bc
Author: Kevin A. Granade <kevin.granade@gmail.com>
Date: Sat Sep 5 01:03:39 2009 -0500
Staging: asus_oled: Cleaned up checkpatch issues.
Fix the image processing by special-casing val == 0.
I have tested this change on an Asus G50V laptop only.
Cc: Jakub Schmidtke <sjakub@gmail.com>
Cc: Kevin A. Granade <kevin.granade@gmail.com>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/asus_oled/asus_oled.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index e77e4e0396cf..2fdc5db68e1a 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c | |||
@@ -355,7 +355,14 @@ static void send_data(struct asus_oled_dev *odev) | |||
355 | 355 | ||
356 | static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count) | 356 | static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count) |
357 | { | 357 | { |
358 | while (count-- > 0 && val) { | 358 | odev->last_val = val; |
359 | |||
360 | if (val == 0) { | ||
361 | odev->buf_offs += count; | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | while (count-- > 0) { | ||
359 | size_t x = odev->buf_offs % odev->width; | 366 | size_t x = odev->buf_offs % odev->width; |
360 | size_t y = odev->buf_offs / odev->width; | 367 | size_t y = odev->buf_offs / odev->width; |
361 | size_t i; | 368 | size_t i; |
@@ -406,7 +413,6 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count) | |||
406 | ; | 413 | ; |
407 | } | 414 | } |
408 | 415 | ||
409 | odev->last_val = val; | ||
410 | odev->buf_offs++; | 416 | odev->buf_offs++; |
411 | } | 417 | } |
412 | 418 | ||