diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-04 15:33:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-04 15:33:01 -0700 |
commit | 2d744b09199d2481c99563fdcf7f1c60f87fd965 (patch) | |
tree | dd99d4c4182c588eda172fbfb05a6e12cf3e407f /drivers/input/mouse/appletouch.c | |
parent | 73e66ceada0b51279ffd4a6f5bffe79d7168d4e8 (diff) | |
download | linux-2d744b09199d2481c99563fdcf7f1c60f87fd965.tar.gz linux-2d744b09199d2481c99563fdcf7f1c60f87fd965.tar.bz2 linux-2d744b09199d2481c99563fdcf7f1c60f87fd965.zip |
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/mouse/appletouch.c')
-rw-r--r-- | drivers/input/mouse/appletouch.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index d0a590f87c2b..38268e8ea469 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -195,6 +195,7 @@ enum atp_status_bits { 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 @@ static int atp_geyser_init(struct atp *dev) 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 @@ static int atp_geyser_init(struct atp *dev) 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 @@ static int atp_geyser_init(struct atp *dev) 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 @@ static void atp_reinit(struct work_struct *work) 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 @@ static int atp_status_check(struct urb *urb) { 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 @@ static int atp_status_check(struct urb *urb) 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 @@ static int atp_status_check(struct urb *urb) 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 @@ static void atp_detect_size(struct atp *dev) 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 @@ static void atp_complete_geyser_1_2(struct urb *urb) 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 @@ static void atp_complete_geyser_3_4(struct urb *urb) 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 @@ static int atp_handle_geyser(struct atp *dev) 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 @@ static int atp_probe(struct usb_interface *iface, } dev->udev = udev; + dev->intf = iface; dev->input = input_dev; dev->info = info; dev->overflow_warned = false; @@ -891,7 +894,7 @@ static void atp_disconnect(struct usb_interface *iface) 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) |