aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/appletouch.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-01 20:56:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-01 20:56:47 -0400
commit80f8594f63dd35179235aa22901dfa5ce786fe00 (patch)
tree3366d249c62a214eb755cbffed4978857440e27e /drivers/input/mouse/appletouch.c
parentaa330384a6444682126de5dd49982fa428badd08 (diff)
USB: input: appletouch.c: fix up dev_err() usage
We should always reference the input device for dev_err(), not the USB device. Fix up the places where I got this wrong. Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: Alessandro Rubini <rubini@ipvvis.unipv.it> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input/mouse/appletouch.c')
-rw-r--r--drivers/input/mouse/appletouch.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 90db679b44af..a5f15477a7ea 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -253,8 +253,9 @@ MODULE_PARM_DESC(debug, "Activate debugging output");
253 * packets (Report ID 2). This code changes device mode, so it 253 * packets (Report ID 2). This code changes device mode, so it
254 * sends raw sensor reports (Report ID 5). 254 * sends raw sensor reports (Report ID 5).
255 */ 255 */
256static int atp_geyser_init(struct usb_device *udev) 256static int atp_geyser_init(struct atp *dev)
257{ 257{
258 struct usb_device *udev = dev->udev;
258 char *data; 259 char *data;
259 int size; 260 int size;
260 int i; 261 int i;
@@ -262,7 +263,7 @@ static int atp_geyser_init(struct usb_device *udev)
262 263
263 data = kmalloc(8, GFP_KERNEL); 264 data = kmalloc(8, GFP_KERNEL);
264 if (!data) { 265 if (!data) {
265 dev_err(&udev->dev, "Out of memory\n"); 266 dev_err(&dev->input->dev, "Out of memory\n");
266 return -ENOMEM; 267 return -ENOMEM;
267 } 268 }
268 269
@@ -277,7 +278,7 @@ static int atp_geyser_init(struct usb_device *udev)
277 for (i = 0; i < 8; i++) 278 for (i = 0; i < 8; i++)
278 dprintk("appletouch[%d]: %d\n", i, data[i]); 279 dprintk("appletouch[%d]: %d\n", i, data[i]);
279 280
280 dev_err(&udev->dev, "Failed to read mode from device.\n"); 281 dev_err(&dev->input->dev, "Failed to read mode from device.\n");
281 ret = -EIO; 282 ret = -EIO;
282 goto out_free; 283 goto out_free;
283 } 284 }
@@ -296,7 +297,7 @@ static int atp_geyser_init(struct usb_device *udev)
296 for (i = 0; i < 8; i++) 297 for (i = 0; i < 8; i++)
297 dprintk("appletouch[%d]: %d\n", i, data[i]); 298 dprintk("appletouch[%d]: %d\n", i, data[i]);
298 299
299 dev_err(&udev->dev, "Failed to request geyser raw mode\n"); 300 dev_err(&dev->input->dev, "Failed to request geyser raw mode\n");
300 ret = -EIO; 301 ret = -EIO;
301 goto out_free; 302 goto out_free;
302 } 303 }
@@ -313,15 +314,14 @@ out_free:
313static void atp_reinit(struct work_struct *work) 314static void atp_reinit(struct work_struct *work)
314{ 315{
315 struct atp *dev = container_of(work, struct atp, work); 316 struct atp *dev = container_of(work, struct atp, work);
316 struct usb_device *udev = dev->udev;
317 int retval; 317 int retval;
318 318
319 dprintk("appletouch: putting appletouch to sleep (reinit)\n"); 319 dprintk("appletouch: putting appletouch to sleep (reinit)\n");
320 atp_geyser_init(udev); 320 atp_geyser_init(dev);
321 321
322 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 322 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
323 if (retval) 323 if (retval)
324 dev_err(&udev->dev, 324 dev_err(&dev->input->dev,
325 "atp_reinit: usb_submit_urb failed with error %d\n", 325 "atp_reinit: usb_submit_urb failed with error %d\n",
326 retval); 326 retval);
327} 327}
@@ -589,7 +589,7 @@ static void atp_complete_geyser_1_2(struct urb *urb)
589 exit: 589 exit:
590 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 590 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
591 if (retval) 591 if (retval)
592 dev_err(&dev->udev->dev, 592 dev_err(&dev->input->dev,
593 "atp_complete: usb_submit_urb failed with result %d\n", 593 "atp_complete: usb_submit_urb failed with result %d\n",
594 retval); 594 retval);
595} 595}
@@ -724,7 +724,7 @@ static void atp_complete_geyser_3_4(struct urb *urb)
724 exit: 724 exit:
725 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 725 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
726 if (retval) 726 if (retval)
727 dev_err(&dev->udev->dev, 727 dev_err(&dev->input->dev,
728 "atp_complete: usb_submit_urb failed with result %d\n", 728 "atp_complete: usb_submit_urb failed with result %d\n",
729 retval); 729 retval);
730} 730}
@@ -751,14 +751,12 @@ static void atp_close(struct input_dev *input)
751 751
752static int atp_handle_geyser(struct atp *dev) 752static int atp_handle_geyser(struct atp *dev)
753{ 753{
754 struct usb_device *udev = dev->udev;
755
756 if (dev->info != &fountain_info) { 754 if (dev->info != &fountain_info) {
757 /* switch to raw sensor mode */ 755 /* switch to raw sensor mode */
758 if (atp_geyser_init(udev)) 756 if (atp_geyser_init(dev))
759 return -EIO; 757 return -EIO;
760 758
761 printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); 759 dev_info(&dev->input->dev, "Geyser mode initialized.\n");
762 } 760 }
763 761
764 return 0; 762 return 0;