diff mbox

hid: fix picolcd's version parsing

Message ID 20100425213140.371194b0@neptune.home (mailing list archive)
State Accepted
Commit 76d17e6ca30204532c631d092de41febb3f76b77
Headers show

Commit Message

Bruno Prémont April 25, 2010, 7:31 p.m. UTC
None
diff mbox

Patch

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");