From patchwork Sun Apr 25 19:31:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Bruno_Pr=C3=A9mont?= X-Patchwork-Id: 94971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3PKGVBY008252 for ; Sun, 25 Apr 2010 20:16:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753978Ab0DYUPr (ORCPT ); Sun, 25 Apr 2010 16:15:47 -0400 Received: from legolas.restena.lu ([158.64.1.34]:56841 "EHLO legolas.restena.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753941Ab0DYUPr convert rfc822-to-8bit (ORCPT ); Sun, 25 Apr 2010 16:15:47 -0400 Received: from legolas.restena.lu (localhost [127.0.0.1]) by legolas.restena.lu (Postfix) with ESMTP id 9D51BA98A0; Sun, 25 Apr 2010 22:15:41 +0200 (CEST) Received: from neptune.home (unknown [158.64.15.115]) by legolas.restena.lu (Postfix) with ESMTP id 6941FAF03A; Sun, 25 Apr 2010 22:15:41 +0200 (CEST) Date: Sun, 25 Apr 2010 21:31:40 +0200 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= To: Jiri Kosina Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] hid: fix picolcd's version parsing Message-ID: <20100425213140.371194b0@neptune.home> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.6; i686-pc-linux-gnu) Mime-Version: 1.0 X-Virus-Scanned: ClamAV Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 25 Apr 2010 20:16:33 +0000 (UTC) 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");