Commit c6f880a7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fb6321b
...@@ -200,6 +200,7 @@ struct hid_descriptor ...@@ -200,6 +200,7 @@ struct hid_descriptor
static void parse_hid_report_descriptor(struct gtco *device, char * report, static void parse_hid_report_descriptor(struct gtco *device, char * report,
int length) int length)
{ {
struct device *ddev = &device->inputdevice->dev;
int x, i = 0; int x, i = 0;
/* Tag primitive vars */ /* Tag primitive vars */
...@@ -226,7 +227,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -226,7 +227,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
char indentstr[10] = ""; char indentstr[10] = "";
dbg("======>>>>>>PARSE<<<<<<======"); dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
/* Walk this report and pull out the info we need */ /* Walk this report and pull out the info we need */
while (i < length) { while (i < length) {
...@@ -275,11 +276,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -275,11 +276,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
else if (data == 3) else if (data == 3)
strcpy(globtype, "Var|Const"); strcpy(globtype, "Var|Const");
dbg("::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits", dev_dbg(ddev, "::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits\n",
globalval[TAG_GLOB_REPORT_ID], inputnum, globalval[TAG_GLOB_REPORT_ID], inputnum,
globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX],
globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN],
globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]); globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]);
/* /*
...@@ -290,7 +291,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -290,7 +291,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
*/ */
switch (inputnum) { switch (inputnum) {
case 0: /* X coord */ case 0: /* X coord */
dbg("GER: X Usage: 0x%x", usage); dev_dbg(ddev, "GER: X Usage: 0x%x\n", usage);
if (device->max_X == 0) { if (device->max_X == 0) {
device->max_X = globalval[TAG_GLOB_LOG_MAX]; device->max_X = globalval[TAG_GLOB_LOG_MAX];
device->min_X = globalval[TAG_GLOB_LOG_MIN]; device->min_X = globalval[TAG_GLOB_LOG_MIN];
...@@ -298,7 +299,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -298,7 +299,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
break; break;
case 1: /* Y coord */ case 1: /* Y coord */
dbg("GER: Y Usage: 0x%x", usage); dev_dbg(ddev, "GER: Y Usage: 0x%x\n", usage);
if (device->max_Y == 0) { if (device->max_Y == 0) {
device->max_Y = globalval[TAG_GLOB_LOG_MAX]; device->max_Y = globalval[TAG_GLOB_LOG_MAX];
device->min_Y = globalval[TAG_GLOB_LOG_MIN]; device->min_Y = globalval[TAG_GLOB_LOG_MIN];
...@@ -348,10 +349,10 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -348,10 +349,10 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
maintype = 'S'; maintype = 'S';
if (data == 0) { if (data == 0) {
dbg("======>>>>>> Physical"); dev_dbg(ddev, "======>>>>>> Physical\n");
strcpy(globtype, "Physical"); strcpy(globtype, "Physical");
} else } else
dbg("======>>>>>>"); dev_dbg(ddev, "======>>>>>>\n");
/* Indent the debug output */ /* Indent the debug output */
indent++; indent++;
...@@ -366,7 +367,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -366,7 +367,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
break; break;
case TAG_MAIN_COL_END: case TAG_MAIN_COL_END:
dbg("<<<<<<======"); dev_dbg(ddev, "<<<<<<======\n");
maintype = 'E'; maintype = 'E';
indent--; indent--;
for (x = 0; x < indent; x++) for (x = 0; x < indent; x++)
...@@ -382,18 +383,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -382,18 +383,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
switch (size) { switch (size) {
case 1: case 1:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data); indentstr, tag, maintype, size, globtype, data);
break; break;
case 2: case 2:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data16); indentstr, tag, maintype, size, globtype, data16);
break; break;
case 4: case 4:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data32); indentstr, tag, maintype, size, globtype, data32);
break; break;
} }
break; break;
...@@ -463,26 +464,26 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -463,26 +464,26 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
if (tag < TAG_GLOB_MAX) { if (tag < TAG_GLOB_MAX) {
switch (size) { switch (size) {
case 1: case 1:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data); indentstr, globtype, tag, size, data);
globalval[tag] = data; globalval[tag] = data;
break; break;
case 2: case 2:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data16); indentstr, globtype, tag, size, data16);
globalval[tag] = data16; globalval[tag] = data16;
break; break;
case 4: case 4:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data32); indentstr, globtype, tag, size, data32);
globalval[tag] = data32; globalval[tag] = data32;
break; break;
} }
} else { } else {
dbg("%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d ", dev_dbg(ddev, "%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d\n",
indentstr, tag, size); indentstr, tag, size);
} }
break; break;
...@@ -509,18 +510,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, ...@@ -509,18 +510,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
switch (size) { switch (size) {
case 1: case 1:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data); indentstr, tag, globtype, size, data);
break; break;
case 2: case 2:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data16); indentstr, tag, globtype, size, data16);
break; break;
case 4: case 4:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data32); indentstr, tag, globtype, size, data32);
break; break;
} }
...@@ -712,8 +713,9 @@ static void gtco_urb_callback(struct urb *urbinfo) ...@@ -712,8 +713,9 @@ static void gtco_urb_callback(struct urb *urbinfo)
* the rest as 0 * the rest as 0
*/ */
val = device->buffer[5] & MASK_BUTTON; val = device->buffer[5] & MASK_BUTTON;
dbg("======>>>>>>REPORT 1: val 0x%X(%d)", dev_dbg(&inputdev->dev,
val, val); "======>>>>>>REPORT 1: val 0x%X(%d)\n",
val, val);
/* /*
* We don't apply any meaning to the button * We don't apply any meaning to the button
...@@ -872,14 +874,14 @@ static int gtco_probe(struct usb_interface *usbinterface, ...@@ -872,14 +874,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
endpoint = &usbinterface->altsetting[0].endpoint[0].desc; endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
/* Some debug */ /* Some debug */
dbg("gtco # interfaces: %d", usbinterface->num_altsetting); dev_dbg(&usbinterface->dev, "gtco # interfaces: %d\n", usbinterface->num_altsetting);
dbg("num endpoints: %d", usbinterface->cur_altsetting->desc.bNumEndpoints); dev_dbg(&usbinterface->dev, "num endpoints: %d\n", usbinterface->cur_altsetting->desc.bNumEndpoints);
dbg("interface class: %d", usbinterface->cur_altsetting->desc.bInterfaceClass); dev_dbg(&usbinterface->dev, "interface class: %d\n", usbinterface->cur_altsetting->desc.bInterfaceClass);
dbg("endpoint: attribute:0x%x type:0x%x", endpoint->bmAttributes, endpoint->bDescriptorType); dev_dbg(&usbinterface->dev, "endpoint: attribute:0x%x type:0x%x\n", endpoint->bmAttributes, endpoint->bDescriptorType);
if (usb_endpoint_xfer_int(endpoint)) if (usb_endpoint_xfer_int(endpoint))
dbg("endpoint: we have interrupt endpoint\n"); dev_dbg(&usbinterface->dev, "endpoint: we have interrupt endpoint\n");
dbg("endpoint extra len:%d ", usbinterface->altsetting[0].extralen); dev_dbg(&usbinterface->dev, "endpoint extra len:%d\n", usbinterface->altsetting[0].extralen);
/* /*
* Find the HID descriptor so we can find out the size of the * 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,8 +895,9 @@ static int gtco_probe(struct usb_interface *usbinterface,
goto err_free_urb; goto err_free_urb;
} }
dbg("Extra descriptor success: type:%d len:%d", dev_dbg(&usbinterface->dev,
hid_desc->bDescriptorType, hid_desc->wDescriptorLength); "Extra descriptor success: type:%d len:%d\n",
hid_desc->bDescriptorType, hid_desc->wDescriptorLength);
report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL); report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
if (!report) { if (!report) {
...@@ -915,7 +918,7 @@ static int gtco_probe(struct usb_interface *usbinterface, ...@@ -915,7 +918,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
le16_to_cpu(hid_desc->wDescriptorLength), le16_to_cpu(hid_desc->wDescriptorLength),
5000); /* 5 secs */ 5000); /* 5 secs */
dbg("usb_control_msg result: %d", result); dev_dbg(&usbinterface->dev, "usb_control_msg result: %d\n", result);
if (result == le16_to_cpu(hid_desc->wDescriptorLength)) { if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
parse_hid_report_descriptor(gtco, report, result); parse_hid_report_descriptor(gtco, report, result);
break; break;
......
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