提交 ed2b2f2d 编写于 作者: G Greg Kroah-Hartman

USB: input: kbtab.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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 27c2597d
...@@ -33,6 +33,7 @@ struct kbtab { ...@@ -33,6 +33,7 @@ struct kbtab {
dma_addr_t data_dma; dma_addr_t data_dma;
struct input_dev *dev; struct input_dev *dev;
struct usb_device *usbdev; struct usb_device *usbdev;
struct usb_interface *intf;
struct urb *irq; struct urb *irq;
char phys[32]; char phys[32];
}; };
...@@ -53,11 +54,13 @@ static void kbtab_irq(struct urb *urb) ...@@ -53,11 +54,13 @@ static void kbtab_irq(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(&dev->dev, "%s - urb shutting down with status: %d\n", dev_dbg(&kbtab->intf->dev,
"%s - urb shutting down with status: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dev_dbg(&dev->dev, "%s - nonzero urb status received: %d\n", dev_dbg(&kbtab->intf->dev,
"%s - nonzero urb status received: %d\n",
__func__, urb->status); __func__, urb->status);
goto exit; goto exit;
} }
...@@ -82,7 +85,7 @@ static void kbtab_irq(struct urb *urb) ...@@ -82,7 +85,7 @@ static void kbtab_irq(struct urb *urb)
exit: exit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
dev_err(&dev->dev, dev_err(&kbtab->intf->dev,
"%s - usb_submit_urb failed with result %d\n", "%s - usb_submit_urb failed with result %d\n",
__func__, retval); __func__, retval);
} }
...@@ -134,6 +137,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -134,6 +137,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
goto fail2; goto fail2;
kbtab->usbdev = dev; kbtab->usbdev = dev;
kbtab->intf = intf;
kbtab->dev = input_dev; kbtab->dev = input_dev;
usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys)); usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册