diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-04 18:33:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-04 18:33:16 -0400 |
commit | 0a5ebc88c74d8029e80a72e57cbebc0b3b4e5d98 (patch) | |
tree | 9e5516d0e1cf6a378f3c912f5d1dd084abecbbf0 /drivers/input | |
parent | 65e78a2062d5e56f906d52c45820d08711d2c2e2 (diff) |
USB: input: usbtouchscreen.c: fix up dev_* messages
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that 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')
-rw-r--r-- | drivers/input/touchscreen/usbtouchscreen.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 100eded96b0e..e32709e0dd65 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -269,7 +269,7 @@ 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 | dev_dbg(&usbtouch->input->dev, | 272 | dev_dbg(&usbtouch->interface->dev, |
273 | "%s - usb_control_msg - E2I_RESET - bytes|err: %d\n", | 273 | "%s - usb_control_msg - E2I_RESET - bytes|err: %d\n", |
274 | __func__, ret); | 274 | __func__, ret); |
275 | return ret; | 275 | return ret; |
@@ -426,7 +426,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
426 | MTOUCHUSB_RESET, | 426 | MTOUCHUSB_RESET, |
427 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 427 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
428 | 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); | 428 | 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); |
429 | dev_dbg(&usbtouch->input->dev, | 429 | dev_dbg(&usbtouch->interface->dev, |
430 | "%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n", | 430 | "%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n", |
431 | __func__, ret); | 431 | __func__, ret); |
432 | if (ret < 0) | 432 | if (ret < 0) |
@@ -438,7 +438,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
438 | MTOUCHUSB_ASYNC_REPORT, | 438 | MTOUCHUSB_ASYNC_REPORT, |
439 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 439 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
440 | 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); | 440 | 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); |
441 | dev_dbg(&usbtouch->input->dev, | 441 | dev_dbg(&usbtouch->interface->dev, |
442 | "%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n", | 442 | "%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n", |
443 | __func__, ret); | 443 | __func__, ret); |
444 | if (ret >= 0) | 444 | if (ret >= 0) |
@@ -740,29 +740,29 @@ static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
740 | #ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC | 740 | #ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC |
741 | static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | 741 | static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
742 | { | 742 | { |
743 | struct input_dev *input = dev->input; | 743 | struct usb_interface *intf = dev->interface; |
744 | 744 | ||
745 | switch (pkt[0]) { | 745 | switch (pkt[0]) { |
746 | case 0x3A: /* command response */ | 746 | case 0x3A: /* command response */ |
747 | dev_dbg(&input->dev, "%s: Command response %d\n", __func__, pkt[1]); | 747 | dev_dbg(&intf->dev, "%s: Command response %d\n", __func__, pkt[1]); |
748 | break; | 748 | break; |
749 | 749 | ||
750 | case 0xC0: /* down */ | 750 | case 0xC0: /* down */ |
751 | dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); | 751 | dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); |
752 | dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); | 752 | dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); |
753 | dev->touch = 1; | 753 | dev->touch = 1; |
754 | dev_dbg(&input->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y); | 754 | dev_dbg(&intf->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y); |
755 | return 1; | 755 | return 1; |
756 | 756 | ||
757 | case 0x80: /* up */ | 757 | case 0x80: /* up */ |
758 | dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); | 758 | dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); |
759 | dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); | 759 | dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); |
760 | dev->touch = 0; | 760 | dev->touch = 0; |
761 | dev_dbg(&input->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y); | 761 | dev_dbg(&intf->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y); |
762 | return 1; | 762 | return 1; |
763 | 763 | ||
764 | default: | 764 | default: |
765 | dev_dbg(&input->dev, "%s: Unknown return %d\n", __func__, pkt[0]); | 765 | dev_dbg(&intf->dev, "%s: Unknown return %d\n", __func__, pkt[0]); |
766 | break; | 766 | break; |
767 | } | 767 | } |
768 | 768 | ||
@@ -817,7 +817,7 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch) | |||
817 | 817 | ||
818 | priv->ack = usb_alloc_urb(0, GFP_KERNEL); | 818 | priv->ack = usb_alloc_urb(0, GFP_KERNEL); |
819 | if (!priv->ack) { | 819 | if (!priv->ack) { |
820 | dev_dbg(&usbtouch->input->dev, | 820 | dev_dbg(&usbtouch->interface->dev, |
821 | "%s - usb_alloc_urb failed: usbtouch->ack\n", __func__); | 821 | "%s - usb_alloc_urb failed: usbtouch->ack\n", __func__); |
822 | goto err_ack_buf; | 822 | goto err_ack_buf; |
823 | } | 823 | } |
@@ -1355,7 +1355,7 @@ out_flush_buf: | |||
1355 | static void usbtouch_irq(struct urb *urb) | 1355 | static void usbtouch_irq(struct urb *urb) |
1356 | { | 1356 | { |
1357 | struct usbtouch_usb *usbtouch = urb->context; | 1357 | struct usbtouch_usb *usbtouch = urb->context; |
1358 | struct device *dev = &usbtouch->input->dev; | 1358 | struct device *dev = &usbtouch->interface->dev; |
1359 | int retval; | 1359 | int retval; |
1360 | 1360 | ||
1361 | switch (urb->status) { | 1361 | switch (urb->status) { |
@@ -1388,8 +1388,7 @@ exit: | |||
1388 | usb_mark_last_busy(interface_to_usbdev(usbtouch->interface)); | 1388 | usb_mark_last_busy(interface_to_usbdev(usbtouch->interface)); |
1389 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 1389 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
1390 | if (retval) | 1390 | if (retval) |
1391 | dev_err(&usbtouch->input->dev, | 1391 | dev_err(dev, "%s - usb_submit_urb failed with result: %d\n", |
1392 | "%s - usb_submit_urb failed with result: %d\n", | ||
1393 | __func__, retval); | 1392 | __func__, retval); |
1394 | } | 1393 | } |
1395 | 1394 | ||
@@ -1465,7 +1464,7 @@ static int usbtouch_reset_resume(struct usb_interface *intf) | |||
1465 | if (usbtouch->type->init) { | 1464 | if (usbtouch->type->init) { |
1466 | err = usbtouch->type->init(usbtouch); | 1465 | err = usbtouch->type->init(usbtouch); |
1467 | if (err) { | 1466 | if (err) { |
1468 | dev_dbg(&input->dev, | 1467 | dev_dbg(&intf->dev, |
1469 | "%s - type->init() failed, err: %d\n", | 1468 | "%s - type->init() failed, err: %d\n", |
1470 | __func__, err); | 1469 | __func__, err); |
1471 | return err; | 1470 | return err; |
@@ -1639,7 +1638,7 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
1639 | err = usb_submit_urb(usbtouch->irq, GFP_KERNEL); | 1638 | err = usb_submit_urb(usbtouch->irq, GFP_KERNEL); |
1640 | if (err) { | 1639 | if (err) { |
1641 | usb_autopm_put_interface(intf); | 1640 | usb_autopm_put_interface(intf); |
1642 | dev_err(&input_dev->dev, | 1641 | dev_err(&intf->dev, |
1643 | "%s - usb_submit_urb failed with result: %d\n", | 1642 | "%s - usb_submit_urb failed with result: %d\n", |
1644 | __func__, err); | 1643 | __func__, err); |
1645 | goto out_unregister_input; | 1644 | goto out_unregister_input; |
@@ -1671,7 +1670,7 @@ static void usbtouch_disconnect(struct usb_interface *intf) | |||
1671 | if (!usbtouch) | 1670 | if (!usbtouch) |
1672 | return; | 1671 | return; |
1673 | 1672 | ||
1674 | dev_dbg(&usbtouch->input->dev, | 1673 | dev_dbg(&intf->dev, |
1675 | "%s - usbtouch is initialized, cleaning up\n", __func__); | 1674 | "%s - usbtouch is initialized, cleaning up\n", __func__); |
1676 | 1675 | ||
1677 | usb_set_intfdata(intf, NULL); | 1676 | usb_set_intfdata(intf, NULL); |