Skip to content

Commit

Permalink
HID: fix picolcd's version parsing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bruno Prémont authored and Jiri Kosina committed Apr 26, 2010
1 parent 5435f28 commit 76d17e6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/hid/hid-picolcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 76d17e6

Please sign in to comment.