Skip to content

Commit

Permalink
USB: input: aiptek.c: fix up dev_* messages
Browse files Browse the repository at this point in the history
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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Jesper Juhl <jj@chaosbits.net>
CC: JJ Ding <dgdunix@gmail.com>
CC: Edwin van Vliet <edwin@cheatah.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed May 4, 2012
1 parent 334698d commit 871ba51
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/input/tablet/aiptek.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ struct aiptek_settings {
struct aiptek {
struct input_dev *inputdev; /* input device struct */
struct usb_device *usbdev; /* usb device struct */
struct usb_interface *intf; /* usb interface struct */
struct urb *urb; /* urb for incoming reports */
dma_addr_t data_dma; /* our dma stuffage */
struct aiptek_features features; /* tablet's array of features */
Expand Down Expand Up @@ -435,6 +436,7 @@ static void aiptek_irq(struct urb *urb)
struct aiptek *aiptek = urb->context;
unsigned char *data = aiptek->data;
struct input_dev *inputdev = aiptek->inputdev;
struct usb_interface *intf = aiptek->intf;
int jitterable = 0;
int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck;

Expand All @@ -447,14 +449,12 @@ static void aiptek_irq(struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* This urb is terminated, clean up */
dev_dbg(&inputdev->dev,
"%s - urb shutting down with status: %d\n",
dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status);
return;

default:
dev_dbg(&inputdev->dev,
"%s - nonzero urb status received: %d\n",
dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status);
goto exit;
}
Expand Down Expand Up @@ -787,7 +787,7 @@ static void aiptek_irq(struct urb *urb)
1 | AIPTEK_REPORT_TOOL_UNKNOWN);
input_sync(inputdev);
} else {
dev_dbg(&inputdev->dev, "Unknown report %d\n", data[0]);
dev_dbg(&intf->dev, "Unknown report %d\n", data[0]);
}

/* Jitter may occur when the user presses a button on the stlyus
Expand All @@ -813,7 +813,7 @@ static void aiptek_irq(struct urb *urb)
exit:
retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval != 0) {
dev_err(&inputdev->dev,
dev_err(&intf->dev,
"%s - usb_submit_urb failed with result %d\n",
__func__, retval);
}
Expand Down Expand Up @@ -915,7 +915,7 @@ aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data)

if ((ret =
aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
dev_dbg(&aiptek->inputdev->dev,
dev_dbg(&aiptek->intf->dev,
"aiptek_program: failed, tried to send: 0x%02x 0x%02x\n",
command, data);
}
Expand Down Expand Up @@ -951,7 +951,7 @@ aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data)

if ((ret =
aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
dev_dbg(&aiptek->inputdev->dev,
dev_dbg(&aiptek->intf->dev,
"aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n",
buf[0], buf[1], buf[2]);
ret = -EIO;
Expand Down Expand Up @@ -1731,6 +1731,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)

aiptek->inputdev = inputdev;
aiptek->usbdev = usbdev;
aiptek->intf = intf;
aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
aiptek->inDelay = 0;
aiptek->endDelay = 0;
Expand Down

0 comments on commit 871ba51

Please sign in to comment.