aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2011-08-16 03:17:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-08-16 03:21:48 -0400
commita417ea4432db7fd1c91c19b129a3e3d2367b7ce4 (patch)
tree26f33a61dec93100ff9313a15ae69e817ea25faa
parent18adad1c57f820d38d05e3d5e3d548e286233b76 (diff)
Input: wacom - add WAC_MSG_RETRIES define
Use WAC_MSG_RETRIES define instead of a numeric constant. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/tablet/wacom_sys.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 449c0a46dbac..9879c73ee517 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -49,6 +49,7 @@ struct hid_descriptor {
49#define USB_REQ_GET_REPORT 0x01 49#define USB_REQ_GET_REPORT 0x01
50#define USB_REQ_SET_REPORT 0x09 50#define USB_REQ_SET_REPORT 0x09
51#define WAC_HID_FEATURE_REPORT 0x03 51#define WAC_HID_FEATURE_REPORT 0x03
52#define WAC_MSG_RETRIES 5
52 53
53static int usb_get_report(struct usb_interface *intf, unsigned char type, 54static int usb_get_report(struct usb_interface *intf, unsigned char type,
54 unsigned char id, void *buf, int size) 55 unsigned char id, void *buf, int size)
@@ -165,7 +166,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
165 report, 166 report,
166 hid_desc->wDescriptorLength, 167 hid_desc->wDescriptorLength,
167 5000); /* 5 secs */ 168 5000); /* 5 secs */
168 } while (result < 0 && limit++ < 5); 169 } while (result < 0 && limit++ < WAC_MSG_RETRIES);
169 170
170 /* No need to parse the Descriptor. It isn't an error though */ 171 /* No need to parse the Descriptor. It isn't an error though */
171 if (result < 0) 172 if (result < 0)
@@ -336,7 +337,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
336 error = usb_get_report(intf, 337 error = usb_get_report(intf,
337 WAC_HID_FEATURE_REPORT, report_id, 338 WAC_HID_FEATURE_REPORT, report_id,
338 rep_data, 3); 339 rep_data, 3);
339 } while ((error < 0 || rep_data[1] != 4) && limit++ < 5); 340 } while ((error < 0 || rep_data[1] != 4) && limit++ < WAC_MSG_RETRIES);
340 } else if (features->type != TABLETPC) { 341 } else if (features->type != TABLETPC) {
341 do { 342 do {
342 rep_data[0] = 2; 343 rep_data[0] = 2;
@@ -347,7 +348,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
347 error = usb_get_report(intf, 348 error = usb_get_report(intf,
348 WAC_HID_FEATURE_REPORT, report_id, 349 WAC_HID_FEATURE_REPORT, report_id,
349 rep_data, 2); 350 rep_data, 2);
350 } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); 351 } while ((error < 0 || rep_data[1] != 2) && limit++ < WAC_MSG_RETRIES);
351 } 352 }
352 353
353 kfree(rep_data); 354 kfree(rep_data);