Commit 8f7292ed authored by Oliver Neukum's avatar Oliver Neukum Committed by Dmitry Torokhov

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: default avatarOliver Neukum <ONeukum@suse.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent ed752e5d
...@@ -31,7 +31,6 @@ struct kbtab { ...@@ -31,7 +31,6 @@ struct kbtab {
unsigned char *data; unsigned char *data;
dma_addr_t data_dma; dma_addr_t data_dma;
struct input_dev *dev; struct input_dev *dev;
struct usb_device *usbdev;
struct usb_interface *intf; struct usb_interface *intf;
struct urb *irq; struct urb *irq;
char phys[32]; char phys[32];
...@@ -99,8 +98,9 @@ MODULE_DEVICE_TABLE(usb, kbtab_ids); ...@@ -99,8 +98,9 @@ MODULE_DEVICE_TABLE(usb, kbtab_ids);
static int kbtab_open(struct input_dev *dev) static int kbtab_open(struct input_dev *dev)
{ {
struct kbtab *kbtab = input_get_drvdata(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)) if (usb_submit_urb(kbtab->irq, GFP_KERNEL))
return -EIO; return -EIO;
...@@ -135,7 +135,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -135,7 +135,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
if (!kbtab->irq) if (!kbtab->irq)
goto fail2; goto fail2;
kbtab->usbdev = dev;
kbtab->intf = intf; kbtab->intf = intf;
kbtab->dev = input_dev; kbtab->dev = input_dev;
...@@ -188,12 +187,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -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) static void kbtab_disconnect(struct usb_interface *intf)
{ {
struct kbtab *kbtab = usb_get_intfdata(intf); struct kbtab *kbtab = usb_get_intfdata(intf);
struct usb_device *udev = interface_to_usbdev(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
input_unregister_device(kbtab->dev); input_unregister_device(kbtab->dev);
usb_free_urb(kbtab->irq); 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); kfree(kbtab);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment