From patchwork Sat Aug 13 00:08:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 1062562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7D06S0T028722 for ; Sat, 13 Aug 2011 00:07:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486Ab1HMAHT (ORCPT ); Fri, 12 Aug 2011 20:07:19 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:59582 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343Ab1HMAHS (ORCPT ); Fri, 12 Aug 2011 20:07:18 -0400 Received: by yxj19 with SMTP id 19so2303383yxj.19 for ; Fri, 12 Aug 2011 17:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=NnuCDUmFnkjCZ9vFE0mdm/+bsi1UXG0vkqPJxNeStIo=; b=knMonNEosXngmrRB8goRew5CnDKXy3K8Bct3LJbcc/3jPlT2hWpMYPe8OmADOKCVTG M/mW1teCH2IDUcVB/KLenJdC1iVO/5oOuwpkXJyQLebieryXl3KyuH5oW/psBsbkh7Z5 MFiiXTXGi3vxM5u3w9cDzv/ga6dyBP0D61IEk= Received: by 10.236.126.144 with SMTP id b16mr5065181yhi.103.1313194038125; Fri, 12 Aug 2011 17:07:18 -0700 (PDT) Received: from localhost.localdomain ([204.119.25.44]) by mx.google.com with ESMTPS id k8sm3962916yhm.59.2011.08.12.17.07.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Aug 2011 17:07:17 -0700 (PDT) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH 3/5] input: wacom - define hardcoded limit Date: Fri, 12 Aug 2011 17:08:57 -0700 Message-Id: <1313194137-5024-1-git-send-email-pinglinux@gmail.com> X-Mailer: git-send-email 1.7.6 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.6 (demeter1.kernel.org [140.211.167.41]); Sat, 13 Aug 2011 00:07:20 +0000 (UTC) From 5 to WAC_MSG_RETRIES Signed-off-by: Ping Cheng --- drivers/input/tablet/wacom_sys.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 36001eb..34edaae 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -49,6 +49,7 @@ struct hid_descriptor { #define USB_REQ_GET_REPORT 0x01 #define USB_REQ_SET_REPORT 0x09 #define WAC_HID_FEATURE_REPORT 0x03 +#define WAC_MSG_RETRIES 5 static int usb_get_report(struct usb_interface *intf, unsigned char type, unsigned char id, void *buf, int size) @@ -165,7 +166,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi report, hid_desc->wDescriptorLength, 5000); /* 5 secs */ - } while (result < 0 && limit++ < 5); + } while (result < 0 && limit++ < WAC_MSG_RETRIES); /* No need to parse the Descriptor. It isn't an error though */ if (result < 0) @@ -322,7 +323,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat error = usb_get_report(intf, WAC_HID_FEATURE_REPORT, report_id, rep_data, 3); - } while ((error < 0 || rep_data[1] != 4) && limit++ < 5); + } while ((error < 0 || rep_data[1] != 4) && limit++ < WAC_MSG_RETRIES); } else if (features->type != TABLETPC) { do { rep_data[0] = 2; @@ -333,7 +334,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat error = usb_get_report(intf, WAC_HID_FEATURE_REPORT, report_id, rep_data, 2); - } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); + } while ((error < 0 || rep_data[1] != 2) && limit++ < WAC_MSG_RETRIES); } kfree(rep_data);