aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-04 18:33:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-04 18:33:01 -0400
commit2d744b09199d2481c99563fdcf7f1c60f87fd965 (patch)
treedd99d4c4182c588eda172fbfb05a6e12cf3e407f /drivers/input
parent73e66ceada0b51279ffd4a6f5bffe79d7168d4e8 (diff)
USB: input: appletouch.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: Alessandro Rubini <rubini@ipvvis.unipv.it> CC: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/appletouch.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index d0a590f87c2..38268e8ea46 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -195,6 +195,7 @@ enum atp_status_bits {
195struct atp { 195struct atp {
196 char phys[64]; 196 char phys[64];
197 struct usb_device *udev; /* usb device */ 197 struct usb_device *udev; /* usb device */
198 struct usb_interface *intf; /* usb interface */
198 struct urb *urb; /* usb request block */ 199 struct urb *urb; /* usb request block */
199 u8 *data; /* transferred data */ 200 u8 *data; /* transferred data */
200 struct input_dev *input; /* input dev */ 201 struct input_dev *input; /* input dev */
@@ -263,7 +264,7 @@ static int atp_geyser_init(struct atp *dev)
263 264
264 data = kmalloc(8, GFP_KERNEL); 265 data = kmalloc(8, GFP_KERNEL);
265 if (!data) { 266 if (!data) {
266 dev_err(&dev->input->dev, "Out of memory\n"); 267 dev_err(&dev->intf->dev, "Out of memory\n");
267 return -ENOMEM; 268 return -ENOMEM;
268 } 269 }
269 270
@@ -278,7 +279,7 @@ static int atp_geyser_init(struct atp *dev)
278 for (i = 0; i < 8; i++) 279 for (i = 0; i < 8; i++)
279 dprintk("appletouch[%d]: %d\n", i, data[i]); 280 dprintk("appletouch[%d]: %d\n", i, data[i]);
280 281
281 dev_err(&dev->input->dev, "Failed to read mode from device.\n"); 282 dev_err(&dev->intf->dev, "Failed to read mode from device.\n");
282 ret = -EIO; 283 ret = -EIO;
283 goto out_free; 284 goto out_free;
284 } 285 }
@@ -297,7 +298,7 @@ static int atp_geyser_init(struct atp *dev)
297 for (i = 0; i < 8; i++) 298 for (i = 0; i < 8; i++)
298 dprintk("appletouch[%d]: %d\n", i, data[i]); 299 dprintk("appletouch[%d]: %d\n", i, data[i]);
299 300
300 dev_err(&dev->input->dev, "Failed to request geyser raw mode\n"); 301 dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n");
301 ret = -EIO; 302 ret = -EIO;
302 goto out_free; 303 goto out_free;
303 } 304 }
@@ -321,7 +322,7 @@ static void atp_reinit(struct work_struct *work)
321 322
322 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 323 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
323 if (retval) 324 if (retval)
324 dev_err(&dev->input->dev, 325 dev_err(&dev->intf->dev,
325 "atp_reinit: usb_submit_urb failed with error %d\n", 326 "atp_reinit: usb_submit_urb failed with error %d\n",
326 retval); 327 retval);
327} 328}
@@ -402,6 +403,7 @@ static int atp_status_check(struct urb *urb)
402{ 403{
403 struct atp *dev = urb->context; 404 struct atp *dev = urb->context;
404 struct input_dev *idev = dev->input; 405 struct input_dev *idev = dev->input;
406 struct usb_interface *intf = dev->intf;
405 407
406 switch (urb->status) { 408 switch (urb->status) {
407 case 0: 409 case 0:
@@ -409,7 +411,7 @@ static int atp_status_check(struct urb *urb)
409 break; 411 break;
410 case -EOVERFLOW: 412 case -EOVERFLOW:
411 if (!dev->overflow_warned) { 413 if (!dev->overflow_warned) {
412 dev_warn(&idev->dev, 414 dev_warn(&intf->dev,
413 "appletouch: OVERFLOW with data length %d, actual length is %d\n", 415 "appletouch: OVERFLOW with data length %d, actual length is %d\n",
414 dev->info->datalen, dev->urb->actual_length); 416 dev->info->datalen, dev->urb->actual_length);
415 dev->overflow_warned = true; 417 dev->overflow_warned = true;
@@ -418,13 +420,13 @@ static int atp_status_check(struct urb *urb)
418 case -ENOENT: 420 case -ENOENT:
419 case -ESHUTDOWN: 421 case -ESHUTDOWN:
420 /* This urb is terminated, clean up */ 422 /* This urb is terminated, clean up */
421 dev_dbg(&idev->dev, 423 dev_dbg(&intf->dev,
422 "atp_complete: urb shutting down with status: %d\n", 424 "atp_complete: urb shutting down with status: %d\n",
423 urb->status); 425 urb->status);
424 return ATP_URB_STATUS_ERROR_FATAL; 426 return ATP_URB_STATUS_ERROR_FATAL;
425 427
426 default: 428 default:
427 dev_dbg(&idev->dev, 429 dev_dbg(&intf->dev,
428 "atp_complete: nonzero urb status received: %d\n", 430 "atp_complete: nonzero urb status received: %d\n",
429 urb->status); 431 urb->status);
430 return ATP_URB_STATUS_ERROR; 432 return ATP_URB_STATUS_ERROR;
@@ -449,7 +451,7 @@ static void atp_detect_size(struct atp *dev)
449 for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { 451 for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) {
450 if (dev->xy_cur[i]) { 452 if (dev->xy_cur[i]) {
451 453
452 dev_info(&dev->input->dev, 454 dev_info(&dev->intf->dev,
453 "appletouch: 17\" model detected.\n"); 455 "appletouch: 17\" model detected.\n");
454 456
455 input_set_abs_params(dev->input, ABS_X, 0, 457 input_set_abs_params(dev->input, ABS_X, 0,
@@ -593,7 +595,7 @@ static void atp_complete_geyser_1_2(struct urb *urb)
593 exit: 595 exit:
594 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 596 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
595 if (retval) 597 if (retval)
596 dev_err(&dev->input->dev, 598 dev_err(&dev->intf->dev,
597 "atp_complete: usb_submit_urb failed with result %d\n", 599 "atp_complete: usb_submit_urb failed with result %d\n",
598 retval); 600 retval);
599} 601}
@@ -728,7 +730,7 @@ static void atp_complete_geyser_3_4(struct urb *urb)
728 exit: 730 exit:
729 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 731 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
730 if (retval) 732 if (retval)
731 dev_err(&dev->input->dev, 733 dev_err(&dev->intf->dev,
732 "atp_complete: usb_submit_urb failed with result %d\n", 734 "atp_complete: usb_submit_urb failed with result %d\n",
733 retval); 735 retval);
734} 736}
@@ -760,7 +762,7 @@ static int atp_handle_geyser(struct atp *dev)
760 if (atp_geyser_init(dev)) 762 if (atp_geyser_init(dev))
761 return -EIO; 763 return -EIO;
762 764
763 dev_info(&dev->input->dev, "Geyser mode initialized.\n"); 765 dev_info(&dev->intf->dev, "Geyser mode initialized.\n");
764 } 766 }
765 767
766 return 0; 768 return 0;
@@ -803,6 +805,7 @@ static int atp_probe(struct usb_interface *iface,
803 } 805 }
804 806
805 dev->udev = udev; 807 dev->udev = udev;
808 dev->intf = iface;
806 dev->input = input_dev; 809 dev->input = input_dev;
807 dev->info = info; 810 dev->info = info;
808 dev->overflow_warned = false; 811 dev->overflow_warned = false;
@@ -891,7 +894,7 @@ static void atp_disconnect(struct usb_interface *iface)
891 usb_free_urb(dev->urb); 894 usb_free_urb(dev->urb);
892 kfree(dev); 895 kfree(dev);
893 } 896 }
894 printk(KERN_INFO "input: appletouch disconnected\n"); 897 dev_info(&iface->dev, "input: appletouch disconnected\n");
895} 898}
896 899
897static int atp_recover(struct atp *dev) 900static int atp_recover(struct atp *dev)