aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/gtco.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:16 -0400
commitc6f880a7812766b896edcba51ac8a449ff5d4320 (patch)
treef7debab25f9fea67f3e1dc423668d6290a55abc2 /drivers/input/tablet/gtco.c
parent8fb6321b6bd9ebcc03243f27fe98e18e246a5c97 (diff)
USB: gtco.c: remove dbg() usage
dbg() was a very old USB-specific macro that should no longer be used. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input/tablet/gtco.c')
-rw-r--r--drivers/input/tablet/gtco.c87
1 files changed, 45 insertions, 42 deletions
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 937215373e95..422b1a2ef309 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -200,6 +200,7 @@ struct hid_descriptor
200static void parse_hid_report_descriptor(struct gtco *device, char * report, 200static void parse_hid_report_descriptor(struct gtco *device, char * report,
201 int length) 201 int length)
202{ 202{
203 struct device *ddev = &device->inputdevice->dev;
203 int x, i = 0; 204 int x, i = 0;
204 205
205 /* Tag primitive vars */ 206 /* Tag primitive vars */
@@ -226,7 +227,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
226 char indentstr[10] = ""; 227 char indentstr[10] = "";
227 228
228 229
229 dbg("======>>>>>>PARSE<<<<<<======"); 230 dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
230 231
231 /* Walk this report and pull out the info we need */ 232 /* Walk this report and pull out the info we need */
232 while (i < length) { 233 while (i < length) {
@@ -275,11 +276,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
275 else if (data == 3) 276 else if (data == 3)
276 strcpy(globtype, "Var|Const"); 277 strcpy(globtype, "Var|Const");
277 278
278 dbg("::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits", 279 dev_dbg(ddev, "::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits\n",
279 globalval[TAG_GLOB_REPORT_ID], inputnum, 280 globalval[TAG_GLOB_REPORT_ID], inputnum,
280 globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], 281 globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX],
281 globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], 282 globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN],
282 globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]); 283 globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]);
283 284
284 285
285 /* 286 /*
@@ -290,7 +291,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
290 */ 291 */
291 switch (inputnum) { 292 switch (inputnum) {
292 case 0: /* X coord */ 293 case 0: /* X coord */
293 dbg("GER: X Usage: 0x%x", usage); 294 dev_dbg(ddev, "GER: X Usage: 0x%x\n", usage);
294 if (device->max_X == 0) { 295 if (device->max_X == 0) {
295 device->max_X = globalval[TAG_GLOB_LOG_MAX]; 296 device->max_X = globalval[TAG_GLOB_LOG_MAX];
296 device->min_X = globalval[TAG_GLOB_LOG_MIN]; 297 device->min_X = globalval[TAG_GLOB_LOG_MIN];
@@ -298,7 +299,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
298 break; 299 break;
299 300
300 case 1: /* Y coord */ 301 case 1: /* Y coord */
301 dbg("GER: Y Usage: 0x%x", usage); 302 dev_dbg(ddev, "GER: Y Usage: 0x%x\n", usage);
302 if (device->max_Y == 0) { 303 if (device->max_Y == 0) {
303 device->max_Y = globalval[TAG_GLOB_LOG_MAX]; 304 device->max_Y = globalval[TAG_GLOB_LOG_MAX];
304 device->min_Y = globalval[TAG_GLOB_LOG_MIN]; 305 device->min_Y = globalval[TAG_GLOB_LOG_MIN];
@@ -348,10 +349,10 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
348 maintype = 'S'; 349 maintype = 'S';
349 350
350 if (data == 0) { 351 if (data == 0) {
351 dbg("======>>>>>> Physical"); 352 dev_dbg(ddev, "======>>>>>> Physical\n");
352 strcpy(globtype, "Physical"); 353 strcpy(globtype, "Physical");
353 } else 354 } else
354 dbg("======>>>>>>"); 355 dev_dbg(ddev, "======>>>>>>\n");
355 356
356 /* Indent the debug output */ 357 /* Indent the debug output */
357 indent++; 358 indent++;
@@ -366,7 +367,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
366 break; 367 break;
367 368
368 case TAG_MAIN_COL_END: 369 case TAG_MAIN_COL_END:
369 dbg("<<<<<<======"); 370 dev_dbg(ddev, "<<<<<<======\n");
370 maintype = 'E'; 371 maintype = 'E';
371 indent--; 372 indent--;
372 for (x = 0; x < indent; x++) 373 for (x = 0; x < indent; x++)
@@ -382,18 +383,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
382 383
383 switch (size) { 384 switch (size) {
384 case 1: 385 case 1:
385 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 386 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
386 indentstr, tag, maintype, size, globtype, data); 387 indentstr, tag, maintype, size, globtype, data);
387 break; 388 break;
388 389
389 case 2: 390 case 2:
390 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 391 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
391 indentstr, tag, maintype, size, globtype, data16); 392 indentstr, tag, maintype, size, globtype, data16);
392 break; 393 break;
393 394
394 case 4: 395 case 4:
395 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 396 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
396 indentstr, tag, maintype, size, globtype, data32); 397 indentstr, tag, maintype, size, globtype, data32);
397 break; 398 break;
398 } 399 }
399 break; 400 break;
@@ -463,26 +464,26 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
463 if (tag < TAG_GLOB_MAX) { 464 if (tag < TAG_GLOB_MAX) {
464 switch (size) { 465 switch (size) {
465 case 1: 466 case 1:
466 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 467 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
467 indentstr, globtype, tag, size, data); 468 indentstr, globtype, tag, size, data);
468 globalval[tag] = data; 469 globalval[tag] = data;
469 break; 470 break;
470 471
471 case 2: 472 case 2:
472 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 473 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
473 indentstr, globtype, tag, size, data16); 474 indentstr, globtype, tag, size, data16);
474 globalval[tag] = data16; 475 globalval[tag] = data16;
475 break; 476 break;
476 477
477 case 4: 478 case 4:
478 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 479 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
479 indentstr, globtype, tag, size, data32); 480 indentstr, globtype, tag, size, data32);
480 globalval[tag] = data32; 481 globalval[tag] = data32;
481 break; 482 break;
482 } 483 }
483 } else { 484 } else {
484 dbg("%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d ", 485 dev_dbg(ddev, "%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d\n",
485 indentstr, tag, size); 486 indentstr, tag, size);
486 } 487 }
487 break; 488 break;
488 489
@@ -509,18 +510,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
509 510
510 switch (size) { 511 switch (size) {
511 case 1: 512 case 1:
512 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 513 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
513 indentstr, tag, globtype, size, data); 514 indentstr, tag, globtype, size, data);
514 break; 515 break;
515 516
516 case 2: 517 case 2:
517 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 518 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
518 indentstr, tag, globtype, size, data16); 519 indentstr, tag, globtype, size, data16);
519 break; 520 break;
520 521
521 case 4: 522 case 4:
522 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 523 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
523 indentstr, tag, globtype, size, data32); 524 indentstr, tag, globtype, size, data32);
524 break; 525 break;
525 } 526 }
526 527
@@ -712,8 +713,9 @@ static void gtco_urb_callback(struct urb *urbinfo)
712 * the rest as 0 713 * the rest as 0
713 */ 714 */
714 val = device->buffer[5] & MASK_BUTTON; 715 val = device->buffer[5] & MASK_BUTTON;
715 dbg("======>>>>>>REPORT 1: val 0x%X(%d)", 716 dev_dbg(&inputdev->dev,
716 val, val); 717 "======>>>>>>REPORT 1: val 0x%X(%d)\n",
718 val, val);
717 719
718 /* 720 /*
719 * We don't apply any meaning to the button 721 * We don't apply any meaning to the button
@@ -872,14 +874,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
872 endpoint = &usbinterface->altsetting[0].endpoint[0].desc; 874 endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
873 875
874 /* Some debug */ 876 /* Some debug */
875 dbg("gtco # interfaces: %d", usbinterface->num_altsetting); 877 dev_dbg(&usbinterface->dev, "gtco # interfaces: %d\n", usbinterface->num_altsetting);
876 dbg("num endpoints: %d", usbinterface->cur_altsetting->desc.bNumEndpoints); 878 dev_dbg(&usbinterface->dev, "num endpoints: %d\n", usbinterface->cur_altsetting->desc.bNumEndpoints);
877 dbg("interface class: %d", usbinterface->cur_altsetting->desc.bInterfaceClass); 879 dev_dbg(&usbinterface->dev, "interface class: %d\n", usbinterface->cur_altsetting->desc.bInterfaceClass);
878 dbg("endpoint: attribute:0x%x type:0x%x", endpoint->bmAttributes, endpoint->bDescriptorType); 880 dev_dbg(&usbinterface->dev, "endpoint: attribute:0x%x type:0x%x\n", endpoint->bmAttributes, endpoint->bDescriptorType);
879 if (usb_endpoint_xfer_int(endpoint)) 881 if (usb_endpoint_xfer_int(endpoint))
880 dbg("endpoint: we have interrupt endpoint\n"); 882 dev_dbg(&usbinterface->dev, "endpoint: we have interrupt endpoint\n");
881 883
882 dbg("endpoint extra len:%d ", usbinterface->altsetting[0].extralen); 884 dev_dbg(&usbinterface->dev, "endpoint extra len:%d\n", usbinterface->altsetting[0].extralen);
883 885
884 /* 886 /*
885 * Find the HID descriptor so we can find out the size of the 887 * Find the HID descriptor so we can find out the size of the
@@ -893,8 +895,9 @@ static int gtco_probe(struct usb_interface *usbinterface,
893 goto err_free_urb; 895 goto err_free_urb;
894 } 896 }
895 897
896 dbg("Extra descriptor success: type:%d len:%d", 898 dev_dbg(&usbinterface->dev,
897 hid_desc->bDescriptorType, hid_desc->wDescriptorLength); 899 "Extra descriptor success: type:%d len:%d\n",
900 hid_desc->bDescriptorType, hid_desc->wDescriptorLength);
898 901
899 report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL); 902 report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
900 if (!report) { 903 if (!report) {
@@ -915,7 +918,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
915 le16_to_cpu(hid_desc->wDescriptorLength), 918 le16_to_cpu(hid_desc->wDescriptorLength),
916 5000); /* 5 secs */ 919 5000); /* 5 secs */
917 920
918 dbg("usb_control_msg result: %d", result); 921 dev_dbg(&usbinterface->dev, "usb_control_msg result: %d\n", result);
919 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) { 922 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
920 parse_hid_report_descriptor(gtco, report, result); 923 parse_hid_report_descriptor(gtco, report, result);
921 break; 924 break;