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>
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index d0a590f..38268e8 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -195,6 +195,7 @@
struct atp {
char phys[64];
struct usb_device *udev; /* usb device */
+ struct usb_interface *intf; /* usb interface */
struct urb *urb; /* usb request block */
u8 *data; /* transferred data */
struct input_dev *input; /* input dev */
@@ -263,7 +264,7 @@
data = kmalloc(8, GFP_KERNEL);
if (!data) {
- dev_err(&dev->input->dev, "Out of memory\n");
+ dev_err(&dev->intf->dev, "Out of memory\n");
return -ENOMEM;
}
@@ -278,7 +279,7 @@
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&dev->input->dev, "Failed to read mode from device.\n");
+ dev_err(&dev->intf->dev, "Failed to read mode from device.\n");
ret = -EIO;
goto out_free;
}
@@ -297,7 +298,7 @@
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&dev->input->dev, "Failed to request geyser raw mode\n");
+ dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n");
ret = -EIO;
goto out_free;
}
@@ -321,7 +322,7 @@
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_reinit: usb_submit_urb failed with error %d\n",
retval);
}
@@ -402,6 +403,7 @@
{
struct atp *dev = urb->context;
struct input_dev *idev = dev->input;
+ struct usb_interface *intf = dev->intf;
switch (urb->status) {
case 0:
@@ -409,7 +411,7 @@
break;
case -EOVERFLOW:
if (!dev->overflow_warned) {
- dev_warn(&idev->dev,
+ dev_warn(&intf->dev,
"appletouch: OVERFLOW with data length %d, actual length is %d\n",
dev->info->datalen, dev->urb->actual_length);
dev->overflow_warned = true;
@@ -418,13 +420,13 @@
case -ENOENT:
case -ESHUTDOWN:
/* This urb is terminated, clean up */
- dev_dbg(&idev->dev,
+ dev_dbg(&intf->dev,
"atp_complete: urb shutting down with status: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR_FATAL;
default:
- dev_dbg(&idev->dev,
+ dev_dbg(&intf->dev,
"atp_complete: nonzero urb status received: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR;
@@ -449,7 +451,7 @@
for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) {
if (dev->xy_cur[i]) {
- dev_info(&dev->input->dev,
+ dev_info(&dev->intf->dev,
"appletouch: 17\" model detected.\n");
input_set_abs_params(dev->input, ABS_X, 0,
@@ -593,7 +595,7 @@
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
@@ -728,7 +730,7 @@
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
@@ -760,7 +762,7 @@
if (atp_geyser_init(dev))
return -EIO;
- dev_info(&dev->input->dev, "Geyser mode initialized.\n");
+ dev_info(&dev->intf->dev, "Geyser mode initialized.\n");
}
return 0;
@@ -803,6 +805,7 @@
}
dev->udev = udev;
+ dev->intf = iface;
dev->input = input_dev;
dev->info = info;
dev->overflow_warned = false;
@@ -891,7 +894,7 @@
usb_free_urb(dev->urb);
kfree(dev);
}
- printk(KERN_INFO "input: appletouch disconnected\n");
+ dev_info(&iface->dev, "input: appletouch disconnected\n");
}
static int atp_recover(struct atp *dev)