aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/usbtouchscreen.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:23 -0400
commitb741ab9da614b08da51cffa961435bc81314f3c4 (patch)
tree29345c3c55023742b4938b23bc4f42ca97d41022 /drivers/input/touchscreen/usbtouchscreen.c
parent6d0f7dcba6ea0d04fb0d1374188c2479abf7f951 (diff)
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>
Diffstat (limited to 'drivers/input/touchscreen/usbtouchscreen.c')
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c68
1 files changed, 42 insertions, 26 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 4127cf7bb25a..100eded96b0e 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -269,8 +269,9 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
269 0x01, 0x02, 0x0000, 0x0081, 269 0x01, 0x02, 0x0000, 0x0081,
270 NULL, 0, USB_CTRL_SET_TIMEOUT); 270 NULL, 0, USB_CTRL_SET_TIMEOUT);
271 271
272 dbg("%s - usb_control_msg - E2I_RESET - bytes|err: %d", 272 dev_dbg(&usbtouch->input->dev,
273 __func__, ret); 273 "%s - usb_control_msg - E2I_RESET - bytes|err: %d\n",
274 __func__, ret);
274 return ret; 275 return ret;
275} 276}
276 277
@@ -425,8 +426,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
425 MTOUCHUSB_RESET, 426 MTOUCHUSB_RESET,
426 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 427 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
427 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); 428 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
428 dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", 429 dev_dbg(&usbtouch->input->dev,
429 __func__, ret); 430 "%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n",
431 __func__, ret);
430 if (ret < 0) 432 if (ret < 0)
431 return ret; 433 return ret;
432 msleep(150); 434 msleep(150);
@@ -436,8 +438,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
436 MTOUCHUSB_ASYNC_REPORT, 438 MTOUCHUSB_ASYNC_REPORT,
437 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 439 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
438 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); 440 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
439 dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", 441 dev_dbg(&usbtouch->input->dev,
440 __func__, ret); 442 "%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n",
443 __func__, ret);
441 if (ret >= 0) 444 if (ret >= 0)
442 break; 445 break;
443 if (ret != -EPIPE) 446 if (ret != -EPIPE)
@@ -737,27 +740,29 @@ static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
737#ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC 740#ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC
738static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 741static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
739{ 742{
743 struct input_dev *input = dev->input;
744
740 switch (pkt[0]) { 745 switch (pkt[0]) {
741 case 0x3A: /* command response */ 746 case 0x3A: /* command response */
742 dbg("%s: Command response %d", __func__, pkt[1]); 747 dev_dbg(&input->dev, "%s: Command response %d\n", __func__, pkt[1]);
743 break; 748 break;
744 749
745 case 0xC0: /* down */ 750 case 0xC0: /* down */
746 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); 751 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
747 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); 752 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
748 dev->touch = 1; 753 dev->touch = 1;
749 dbg("%s: down %d,%d", __func__, dev->x, dev->y); 754 dev_dbg(&input->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y);
750 return 1; 755 return 1;
751 756
752 case 0x80: /* up */ 757 case 0x80: /* up */
753 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); 758 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
754 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); 759 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
755 dev->touch = 0; 760 dev->touch = 0;
756 dbg("%s: up %d,%d", __func__, dev->x, dev->y); 761 dev_dbg(&input->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y);
757 return 1; 762 return 1;
758 763
759 default: 764 default:
760 dbg("%s: Unknown return %d", __func__, pkt[0]); 765 dev_dbg(&input->dev, "%s: Unknown return %d\n", __func__, pkt[0]);
761 break; 766 break;
762 } 767 }
763 768
@@ -812,7 +817,8 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch)
812 817
813 priv->ack = usb_alloc_urb(0, GFP_KERNEL); 818 priv->ack = usb_alloc_urb(0, GFP_KERNEL);
814 if (!priv->ack) { 819 if (!priv->ack) {
815 dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__); 820 dev_dbg(&usbtouch->input->dev,
821 "%s - usb_alloc_urb failed: usbtouch->ack\n", __func__);
816 goto err_ack_buf; 822 goto err_ack_buf;
817 } 823 }
818 824
@@ -1349,6 +1355,7 @@ out_flush_buf:
1349static void usbtouch_irq(struct urb *urb) 1355static void usbtouch_irq(struct urb *urb)
1350{ 1356{
1351 struct usbtouch_usb *usbtouch = urb->context; 1357 struct usbtouch_usb *usbtouch = urb->context;
1358 struct device *dev = &usbtouch->input->dev;
1352 int retval; 1359 int retval;
1353 1360
1354 switch (urb->status) { 1361 switch (urb->status) {
@@ -1357,20 +1364,21 @@ static void usbtouch_irq(struct urb *urb)
1357 break; 1364 break;
1358 case -ETIME: 1365 case -ETIME:
1359 /* this urb is timing out */ 1366 /* this urb is timing out */
1360 dbg("%s - urb timed out - was the device unplugged?", 1367 dev_dbg(dev,
1361 __func__); 1368 "%s - urb timed out - was the device unplugged?\n",
1369 __func__);
1362 return; 1370 return;
1363 case -ECONNRESET: 1371 case -ECONNRESET:
1364 case -ENOENT: 1372 case -ENOENT:
1365 case -ESHUTDOWN: 1373 case -ESHUTDOWN:
1366 case -EPIPE: 1374 case -EPIPE:
1367 /* this urb is terminated, clean up */ 1375 /* this urb is terminated, clean up */
1368 dbg("%s - urb shutting down with status: %d", 1376 dev_dbg(dev, "%s - urb shutting down with status: %d\n",
1369 __func__, urb->status); 1377 __func__, urb->status);
1370 return; 1378 return;
1371 default: 1379 default:
1372 dbg("%s - nonzero urb status received: %d", 1380 dev_dbg(dev, "%s - nonzero urb status received: %d\n",
1373 __func__, urb->status); 1381 __func__, urb->status);
1374 goto exit; 1382 goto exit;
1375 } 1383 }
1376 1384
@@ -1457,8 +1465,9 @@ static int usbtouch_reset_resume(struct usb_interface *intf)
1457 if (usbtouch->type->init) { 1465 if (usbtouch->type->init) {
1458 err = usbtouch->type->init(usbtouch); 1466 err = usbtouch->type->init(usbtouch);
1459 if (err) { 1467 if (err) {
1460 dbg("%s - type->init() failed, err: %d", 1468 dev_dbg(&input->dev,
1461 __func__, err); 1469 "%s - type->init() failed, err: %d\n",
1470 __func__, err);
1462 return err; 1471 return err;
1463 } 1472 }
1464 } 1473 }
@@ -1533,7 +1542,8 @@ static int usbtouch_probe(struct usb_interface *intf,
1533 1542
1534 usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); 1543 usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
1535 if (!usbtouch->irq) { 1544 if (!usbtouch->irq) {
1536 dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__); 1545 dev_dbg(&intf->dev,
1546 "%s - usb_alloc_urb failed: usbtouch->irq\n", __func__);
1537 goto out_free_buffers; 1547 goto out_free_buffers;
1538 } 1548 }
1539 1549
@@ -1595,7 +1605,9 @@ static int usbtouch_probe(struct usb_interface *intf,
1595 if (type->alloc) { 1605 if (type->alloc) {
1596 err = type->alloc(usbtouch); 1606 err = type->alloc(usbtouch);
1597 if (err) { 1607 if (err) {
1598 dbg("%s - type->alloc() failed, err: %d", __func__, err); 1608 dev_dbg(&intf->dev,
1609 "%s - type->alloc() failed, err: %d\n",
1610 __func__, err);
1599 goto out_free_urb; 1611 goto out_free_urb;
1600 } 1612 }
1601 } 1613 }
@@ -1604,14 +1616,18 @@ static int usbtouch_probe(struct usb_interface *intf,
1604 if (type->init) { 1616 if (type->init) {
1605 err = type->init(usbtouch); 1617 err = type->init(usbtouch);
1606 if (err) { 1618 if (err) {
1607 dbg("%s - type->init() failed, err: %d", __func__, err); 1619 dev_dbg(&intf->dev,
1620 "%s - type->init() failed, err: %d\n",
1621 __func__, err);
1608 goto out_do_exit; 1622 goto out_do_exit;
1609 } 1623 }
1610 } 1624 }
1611 1625
1612 err = input_register_device(usbtouch->input); 1626 err = input_register_device(usbtouch->input);
1613 if (err) { 1627 if (err) {
1614 dbg("%s - input_register_device failed, err: %d", __func__, err); 1628 dev_dbg(&intf->dev,
1629 "%s - input_register_device failed, err: %d\n",
1630 __func__, err);
1615 goto out_do_exit; 1631 goto out_do_exit;
1616 } 1632 }
1617 1633
@@ -1652,12 +1668,12 @@ static void usbtouch_disconnect(struct usb_interface *intf)
1652{ 1668{
1653 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); 1669 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1654 1670
1655 dbg("%s - called", __func__);
1656
1657 if (!usbtouch) 1671 if (!usbtouch)
1658 return; 1672 return;
1659 1673
1660 dbg("%s - usbtouch is initialized, cleaning up", __func__); 1674 dev_dbg(&usbtouch->input->dev,
1675 "%s - usbtouch is initialized, cleaning up\n", __func__);
1676
1661 usb_set_intfdata(intf, NULL); 1677 usb_set_intfdata(intf, NULL);
1662 /* this will stop IO via close */ 1678 /* this will stop IO via close */
1663 input_unregister_device(usbtouch->input); 1679 input_unregister_device(usbtouch->input);