diff options
author | Oliver Neukum <oneukum@suse.com> | 2016-03-31 11:01:48 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-03-31 13:13:42 -0700 |
commit | 8f7292ed88c0a87e4173c5a97fae444ed8b2f05b (patch) | |
tree | 1dac88feb65602c790cad99faef7deeeb306c9c4 /drivers/input/tablet | |
parent | ed752e5ddedb68c9d69484baa1a712cf966e1f22 (diff) | |
download | linux-rt-8f7292ed88c0a87e4173c5a97fae444ed8b2f05b.tar.gz |
Input: kbtab - stop saving struct usb_device
The device can now easily be derived from the interface.
Stop leaving a private copy.
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/kbtab.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index d2ac7c2b5b82..e850d7e8afbc 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -31,7 +31,6 @@ struct kbtab { unsigned char *data; dma_addr_t data_dma; struct input_dev *dev; - struct usb_device *usbdev; struct usb_interface *intf; struct urb *irq; char phys[32]; @@ -99,8 +98,9 @@ MODULE_DEVICE_TABLE(usb, kbtab_ids); static int kbtab_open(struct input_dev *dev) { struct kbtab *kbtab = input_get_drvdata(dev); + struct usb_device *udev = interface_to_usbdev(kbtab->intf); - kbtab->irq->dev = kbtab->usbdev; + kbtab->irq->dev = udev; if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) return -EIO; @@ -135,7 +135,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i if (!kbtab->irq) goto fail2; - kbtab->usbdev = dev; kbtab->intf = intf; kbtab->dev = input_dev; @@ -188,12 +187,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i static void kbtab_disconnect(struct usb_interface *intf) { struct kbtab *kbtab = usb_get_intfdata(intf); + struct usb_device *udev = interface_to_usbdev(intf); usb_set_intfdata(intf, NULL); input_unregister_device(kbtab->dev); usb_free_urb(kbtab->irq); - usb_free_coherent(kbtab->usbdev, 8, kbtab->data, kbtab->data_dma); + usb_free_coherent(udev, 8, kbtab->data, kbtab->data_dma); kfree(kbtab); } |