Skip to content

Commit

Permalink
USB: input: iforce: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed May 4, 2012
1 parent 4db02fe commit a852d78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/input/joystick/iforce/iforce-packets.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)

status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
if (status) {
dev_err(&iforce->dev->dev,
dev_err(&iforce->intf->dev,
"usb_submit_urb failed %d\n", status);
return -1;
}
Expand All @@ -266,7 +266,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
iforce->ctrl->status != -EINPROGRESS, HZ);

if (iforce->ctrl->status) {
dev_dbg(&iforce->dev->dev,
dev_dbg(&iforce->intf->dev,
"iforce->ctrl->status = %d\n",
iforce->ctrl->status);
usb_unlink_urb(iforce->ctrl);
Expand Down
7 changes: 4 additions & 3 deletions drivers/input/joystick/iforce/iforce-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void iforce_usb_xmit(struct iforce *iforce)

if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
dev_warn(&iforce->dev->dev, "usb_submit_urb failed %d\n", n);
dev_warn(&iforce->intf->dev, "usb_submit_urb failed %d\n", n);
}

/* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
Expand All @@ -76,7 +76,7 @@ void iforce_usb_xmit(struct iforce *iforce)
static void iforce_usb_irq(struct urb *urb)
{
struct iforce *iforce = urb->context;
struct device *dev = &iforce->dev->dev;
struct device *dev = &iforce->intf->dev;
int status;

switch (urb->status) {
Expand Down Expand Up @@ -112,7 +112,7 @@ static void iforce_usb_out(struct urb *urb)

if (urb->status) {
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
dev_dbg(&iforce->dev->dev, "urb->status %d, exiting\n",
dev_dbg(&iforce->intf->dev, "urb->status %d, exiting\n",
urb->status);
return;
}
Expand Down Expand Up @@ -158,6 +158,7 @@ static int iforce_usb_probe(struct usb_interface *intf,

iforce->bus = IFORCE_USB;
iforce->usbdev = dev;
iforce->intf = intf;

iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE;
iforce->cr.wIndex = 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/input/joystick/iforce/iforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct iforce {
#endif
#ifdef CONFIG_JOYSTICK_IFORCE_USB
struct usb_device *usbdev; /* USB transfer */
struct usb_interface *intf;
struct urb *irq, *out, *ctrl;
struct usb_ctrlrequest cr;
#endif
Expand Down

0 comments on commit a852d78

Please sign in to comment.