HID: fix picolcd's version parsing
authorBruno Prémont <bonbons@linux-vserver.org>
Sun, 25 Apr 2010 19:31:40 +0000 (21:31 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 26 Apr 2010 09:44:09 +0000 (11:44 +0200)
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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-picolcd.c

index 0fbc7d396164d87eb32e84079c121f35b28f2aba..6f71c60bf65315b5c4e9a179e4a332299df6e01c 100644 (file)
@@ -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");