aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2016-03-31 14:01:48 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-31 16:13:42 -0400
commit8f7292ed88c0a87e4173c5a97fae444ed8b2f05b (patch)
tree1dac88feb65602c790cad99faef7deeeb306c9c4
parented752e5ddedb68c9d69484baa1a712cf966e1f22 (diff)
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>
-rw-r--r--drivers/input/tablet/kbtab.c8
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 {
31 unsigned char *data; 31 unsigned char *data;
32 dma_addr_t data_dma; 32 dma_addr_t data_dma;
33 struct input_dev *dev; 33 struct input_dev *dev;
34 struct usb_device *usbdev;
35 struct usb_interface *intf; 34 struct usb_interface *intf;
36 struct urb *irq; 35 struct urb *irq;
37 char phys[32]; 36 char phys[32];
@@ -99,8 +98,9 @@ MODULE_DEVICE_TABLE(usb, kbtab_ids);
99static int kbtab_open(struct input_dev *dev) 98static int kbtab_open(struct input_dev *dev)
100{ 99{
101 struct kbtab *kbtab = input_get_drvdata(dev); 100 struct kbtab *kbtab = input_get_drvdata(dev);
101 struct usb_device *udev = interface_to_usbdev(kbtab->intf);
102 102
103 kbtab->irq->dev = kbtab->usbdev; 103 kbtab->irq->dev = udev;
104 if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) 104 if (usb_submit_urb(kbtab->irq, GFP_KERNEL))
105 return -EIO; 105 return -EIO;
106 106
@@ -135,7 +135,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
135 if (!kbtab->irq) 135 if (!kbtab->irq)
136 goto fail2; 136 goto fail2;
137 137
138 kbtab->usbdev = dev;
139 kbtab->intf = intf; 138 kbtab->intf = intf;
140 kbtab->dev = input_dev; 139 kbtab->dev = input_dev;
141 140
@@ -188,12 +187,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
188static void kbtab_disconnect(struct usb_interface *intf) 187static void kbtab_disconnect(struct usb_interface *intf)
189{ 188{
190 struct kbtab *kbtab = usb_get_intfdata(intf); 189 struct kbtab *kbtab = usb_get_intfdata(intf);
190 struct usb_device *udev = interface_to_usbdev(intf);
191 191
192 usb_set_intfdata(intf, NULL); 192 usb_set_intfdata(intf, NULL);
193 193
194 input_unregister_device(kbtab->dev); 194 input_unregister_device(kbtab->dev);
195 usb_free_urb(kbtab->irq); 195 usb_free_urb(kbtab->irq);
196 usb_free_coherent(kbtab->usbdev, 8, kbtab->data, kbtab->data_dma); 196 usb_free_coherent(udev, 8, kbtab->data, kbtab->data_dma);
197 kfree(kbtab); 197 kfree(kbtab);
198} 198}
199 199