Commit 2d744b09 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73e66cea
...@@ -195,6 +195,7 @@ enum atp_status_bits { ...@@ -195,6 +195,7 @@ enum atp_status_bits {
struct atp { struct atp {
char phys[64]; char phys[64];
struct usb_device *udev; /* usb device */ struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* usb interface */
struct urb *urb; /* usb request block */ struct urb *urb; /* usb request block */
u8 *data; /* transferred data */ u8 *data; /* transferred data */
struct input_dev *input; /* input dev */ struct input_dev *input; /* input dev */
...@@ -263,7 +264,7 @@ static int atp_geyser_init(struct atp *dev) ...@@ -263,7 +264,7 @@ static int atp_geyser_init(struct atp *dev)
data = kmalloc(8, GFP_KERNEL); data = kmalloc(8, GFP_KERNEL);
if (!data) { if (!data) {
dev_err(&dev->input->dev, "Out of memory\n"); dev_err(&dev->intf->dev, "Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -278,7 +279,7 @@ static int atp_geyser_init(struct atp *dev) ...@@ -278,7 +279,7 @@ static int atp_geyser_init(struct atp *dev)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[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; ret = -EIO;
goto out_free; goto out_free;
} }
...@@ -297,7 +298,7 @@ static int atp_geyser_init(struct atp *dev) ...@@ -297,7 +298,7 @@ static int atp_geyser_init(struct atp *dev)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[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; ret = -EIO;
goto out_free; goto out_free;
} }
...@@ -321,7 +322,7 @@ static void atp_reinit(struct work_struct *work) ...@@ -321,7 +322,7 @@ static void atp_reinit(struct work_struct *work)
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
dev_err(&dev->input->dev, dev_err(&dev->intf->dev,
"atp_reinit: usb_submit_urb failed with error %d\n", "atp_reinit: usb_submit_urb failed with error %d\n",
retval); retval);
} }
...@@ -402,6 +403,7 @@ static int atp_status_check(struct urb *urb) ...@@ -402,6 +403,7 @@ static int atp_status_check(struct urb *urb)
{ {
struct atp *dev = urb->context; struct atp *dev = urb->context;
struct input_dev *idev = dev->input; struct input_dev *idev = dev->input;
struct usb_interface *intf = dev->intf;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
...@@ -409,7 +411,7 @@ static int atp_status_check(struct urb *urb) ...@@ -409,7 +411,7 @@ static int atp_status_check(struct urb *urb)
break; break;
case -EOVERFLOW: case -EOVERFLOW:
if (!dev->overflow_warned) { if (!dev->overflow_warned) {
dev_warn(&idev->dev, dev_warn(&intf->dev,
"appletouch: OVERFLOW with data length %d, actual length is %d\n", "appletouch: OVERFLOW with data length %d, actual length is %d\n",
dev->info->datalen, dev->urb->actual_length); dev->info->datalen, dev->urb->actual_length);
dev->overflow_warned = true; dev->overflow_warned = true;
...@@ -418,13 +420,13 @@ static int atp_status_check(struct urb *urb) ...@@ -418,13 +420,13 @@ static int atp_status_check(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* This urb is terminated, clean up */ /* This urb is terminated, clean up */
dev_dbg(&idev->dev, dev_dbg(&intf->dev,
"atp_complete: urb shutting down with status: %d\n", "atp_complete: urb shutting down with status: %d\n",
urb->status); urb->status);
return ATP_URB_STATUS_ERROR_FATAL; return ATP_URB_STATUS_ERROR_FATAL;
default: default:
dev_dbg(&idev->dev, dev_dbg(&intf->dev,
"atp_complete: nonzero urb status received: %d\n", "atp_complete: nonzero urb status received: %d\n",
urb->status); urb->status);
return ATP_URB_STATUS_ERROR; return ATP_URB_STATUS_ERROR;
...@@ -449,7 +451,7 @@ static void atp_detect_size(struct atp *dev) ...@@ -449,7 +451,7 @@ static void atp_detect_size(struct atp *dev)
for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) {
if (dev->xy_cur[i]) { if (dev->xy_cur[i]) {
dev_info(&dev->input->dev, dev_info(&dev->intf->dev,
"appletouch: 17\" model detected.\n"); "appletouch: 17\" model detected.\n");
input_set_abs_params(dev->input, ABS_X, 0, input_set_abs_params(dev->input, ABS_X, 0,
...@@ -593,7 +595,7 @@ static void atp_complete_geyser_1_2(struct urb *urb) ...@@ -593,7 +595,7 @@ static void atp_complete_geyser_1_2(struct urb *urb)
exit: exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
dev_err(&dev->input->dev, dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n", "atp_complete: usb_submit_urb failed with result %d\n",
retval); retval);
} }
...@@ -728,7 +730,7 @@ static void atp_complete_geyser_3_4(struct urb *urb) ...@@ -728,7 +730,7 @@ static void atp_complete_geyser_3_4(struct urb *urb)
exit: exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
dev_err(&dev->input->dev, dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n", "atp_complete: usb_submit_urb failed with result %d\n",
retval); retval);
} }
...@@ -760,7 +762,7 @@ static int atp_handle_geyser(struct atp *dev) ...@@ -760,7 +762,7 @@ static int atp_handle_geyser(struct atp *dev)
if (atp_geyser_init(dev)) if (atp_geyser_init(dev))
return -EIO; return -EIO;
dev_info(&dev->input->dev, "Geyser mode initialized.\n"); dev_info(&dev->intf->dev, "Geyser mode initialized.\n");
} }
return 0; return 0;
...@@ -803,6 +805,7 @@ static int atp_probe(struct usb_interface *iface, ...@@ -803,6 +805,7 @@ static int atp_probe(struct usb_interface *iface,
} }
dev->udev = udev; dev->udev = udev;
dev->intf = iface;
dev->input = input_dev; dev->input = input_dev;
dev->info = info; dev->info = info;
dev->overflow_warned = false; dev->overflow_warned = false;
...@@ -891,7 +894,7 @@ static void atp_disconnect(struct usb_interface *iface) ...@@ -891,7 +894,7 @@ static void atp_disconnect(struct usb_interface *iface)
usb_free_urb(dev->urb); usb_free_urb(dev->urb);
kfree(dev); kfree(dev);
} }
printk(KERN_INFO "input: appletouch disconnected\n"); dev_info(&iface->dev, "input: appletouch disconnected\n");
} }
static int atp_recover(struct atp *dev) static int atp_recover(struct atp *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment