Commit 76d17e6c authored by Bruno Prémont's avatar Bruno Prémont Committed by Jiri Kosina

HID: fix picolcd's version parsing

During grouping of version checking code bootloader mode's version
bytes got swapped. Fix their order.
Signed-off-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 5435f281
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment