[PATCH] hid: fix picolcd's version parsing

Previous thread: [PATCH 1/2] hid: add suspend/resume hooks for hid drivers by Bruno Prémont on Sunday, April 25, 2010 - 12:40 pm. (2 messages)

Next thread: [2.6.34-rc5] bad page state copying to/from HFS+ filesystem... by Daniel J Blueman on Sunday, April 25, 2010 - 2:14 pm. (1 message)
From: Bruno Prémont
Date: Sunday, April 25, 2010 - 12:31 pm

During grouping of version checking code bootloader mode's version
bytes got swapped. Fix their order.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
---
 drivers/hid/hid-picolcd.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 0fbc7d3..6f71c60 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -1196,16 +1196,14 @@ static int picolcd_check_version(struct hid_device *hdev)
 	}
 
 	if (verinfo->raw_size == 2) {
+		data->version[0] = verinfo->raw_data[1];
+		data->version[1] = verinfo->raw_data[0];
 		if (data->status & PICOLCD_BOOTLOADER) {
 			dev_info(&hdev->dev, "PicoLCD, bootloader version %d.%d\n",
-					verinfo->raw_data[0], verinfo->raw_data[1]);
-			data->version[0] = verinfo->raw_data[0];
-			data->version[1] = verinfo->raw_data[1];
+					verinfo->raw_data[1], verinfo->raw_data[0]);
 		} else {
 			dev_info(&hdev->dev, "PicoLCD, firmware version %d.%d\n",
 					verinfo->raw_data[1], verinfo->raw_data[0]);
-			data->version[0] = verinfo->raw_data[1];
-			data->version[1] = verinfo->raw_data[0];
 		}
 	} else {
 		dev_err(&hdev->dev, "confused, got unexpected version response from PicoLCD\n");
-- 
1.6.4.4

--

From: Jiri Kosina
Date: Monday, April 26, 2010 - 2:44 am

Applied, thanks Bruno.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--

Previous thread: [PATCH 1/2] hid: add suspend/resume hooks for hid drivers by Bruno Prémont on Sunday, April 25, 2010 - 12:40 pm. (2 messages)

Next thread: [2.6.34-rc5] bad page state copying to/from HFS+ filesystem... by Daniel J Blueman on Sunday, April 25, 2010 - 2:14 pm. (1 message)