USB: usbtouchscreen.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>
CC: Henrik Rydberg <rydberg@euromail.se>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Viresh Kumar <viresh.kumar@st.com>
CC: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2012-05-01 21:33:23 -07:00
parent 6d0f7dcba6
commit b741ab9da6

View file

@ -269,8 +269,9 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
0x01, 0x02, 0x0000, 0x0081, 0x01, 0x02, 0x0000, 0x0081,
NULL, 0, USB_CTRL_SET_TIMEOUT); NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - E2I_RESET - bytes|err: %d", dev_dbg(&usbtouch->input->dev,
__func__, ret); "%s - usb_control_msg - E2I_RESET - bytes|err: %d\n",
__func__, ret);
return ret; return ret;
} }
@ -425,8 +426,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
MTOUCHUSB_RESET, MTOUCHUSB_RESET,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", dev_dbg(&usbtouch->input->dev,
__func__, ret); "%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n",
__func__, ret);
if (ret < 0) if (ret < 0)
return ret; return ret;
msleep(150); msleep(150);
@ -436,8 +438,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
MTOUCHUSB_ASYNC_REPORT, MTOUCHUSB_ASYNC_REPORT,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", dev_dbg(&usbtouch->input->dev,
__func__, ret); "%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n",
__func__, ret);
if (ret >= 0) if (ret >= 0)
break; break;
if (ret != -EPIPE) if (ret != -EPIPE)
@ -737,27 +740,29 @@ static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
#ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC #ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC
static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{ {
struct input_dev *input = dev->input;
switch (pkt[0]) { switch (pkt[0]) {
case 0x3A: /* command response */ case 0x3A: /* command response */
dbg("%s: Command response %d", __func__, pkt[1]); dev_dbg(&input->dev, "%s: Command response %d\n", __func__, pkt[1]);
break; break;
case 0xC0: /* down */ case 0xC0: /* down */
dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
dev->touch = 1; dev->touch = 1;
dbg("%s: down %d,%d", __func__, dev->x, dev->y); dev_dbg(&input->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y);
return 1; return 1;
case 0x80: /* up */ case 0x80: /* up */
dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
dev->touch = 0; dev->touch = 0;
dbg("%s: up %d,%d", __func__, dev->x, dev->y); dev_dbg(&input->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y);
return 1; return 1;
default: default:
dbg("%s: Unknown return %d", __func__, pkt[0]); dev_dbg(&input->dev, "%s: Unknown return %d\n", __func__, pkt[0]);
break; break;
} }
@ -812,7 +817,8 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch)
priv->ack = usb_alloc_urb(0, GFP_KERNEL); priv->ack = usb_alloc_urb(0, GFP_KERNEL);
if (!priv->ack) { if (!priv->ack) {
dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__); dev_dbg(&usbtouch->input->dev,
"%s - usb_alloc_urb failed: usbtouch->ack\n", __func__);
goto err_ack_buf; goto err_ack_buf;
} }
@ -1349,6 +1355,7 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
static void usbtouch_irq(struct urb *urb) static void usbtouch_irq(struct urb *urb)
{ {
struct usbtouch_usb *usbtouch = urb->context; struct usbtouch_usb *usbtouch = urb->context;
struct device *dev = &usbtouch->input->dev;
int retval; int retval;
switch (urb->status) { switch (urb->status) {
@ -1357,20 +1364,21 @@ static void usbtouch_irq(struct urb *urb)
break; break;
case -ETIME: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dev_dbg(dev,
__func__); "%s - urb timed out - was the device unplugged?\n",
__func__);
return; return;
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
case -EPIPE: case -EPIPE:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status); __func__, urb->status);
goto exit; goto exit;
} }
@ -1457,8 +1465,9 @@ static int usbtouch_reset_resume(struct usb_interface *intf)
if (usbtouch->type->init) { if (usbtouch->type->init) {
err = usbtouch->type->init(usbtouch); err = usbtouch->type->init(usbtouch);
if (err) { if (err) {
dbg("%s - type->init() failed, err: %d", dev_dbg(&input->dev,
__func__, err); "%s - type->init() failed, err: %d\n",
__func__, err);
return err; return err;
} }
} }
@ -1533,7 +1542,8 @@ static int usbtouch_probe(struct usb_interface *intf,
usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
if (!usbtouch->irq) { if (!usbtouch->irq) {
dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__); dev_dbg(&intf->dev,
"%s - usb_alloc_urb failed: usbtouch->irq\n", __func__);
goto out_free_buffers; goto out_free_buffers;
} }
@ -1595,7 +1605,9 @@ static int usbtouch_probe(struct usb_interface *intf,
if (type->alloc) { if (type->alloc) {
err = type->alloc(usbtouch); err = type->alloc(usbtouch);
if (err) { if (err) {
dbg("%s - type->alloc() failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - type->alloc() failed, err: %d\n",
__func__, err);
goto out_free_urb; goto out_free_urb;
} }
} }
@ -1604,14 +1616,18 @@ static int usbtouch_probe(struct usb_interface *intf,
if (type->init) { if (type->init) {
err = type->init(usbtouch); err = type->init(usbtouch);
if (err) { if (err) {
dbg("%s - type->init() failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - type->init() failed, err: %d\n",
__func__, err);
goto out_do_exit; goto out_do_exit;
} }
} }
err = input_register_device(usbtouch->input); err = input_register_device(usbtouch->input);
if (err) { if (err) {
dbg("%s - input_register_device failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - input_register_device failed, err: %d\n",
__func__, err);
goto out_do_exit; goto out_do_exit;
} }
@ -1652,12 +1668,12 @@ static void usbtouch_disconnect(struct usb_interface *intf)
{ {
struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
dbg("%s - called", __func__);
if (!usbtouch) if (!usbtouch)
return; return;
dbg("%s - usbtouch is initialized, cleaning up", __func__); dev_dbg(&usbtouch->input->dev,
"%s - usbtouch is initialized, cleaning up\n", __func__);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
/* this will stop IO via close */ /* this will stop IO via close */
input_unregister_device(usbtouch->input); input_unregister_device(usbtouch->input);