aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/xpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input/xpad.c')
-rw-r--r--drivers/usb/input/xpad.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c
index a8076ccc0b2e..a7fa1b17dcfe 100644
--- a/drivers/usb/input/xpad.c
+++ b/drivers/usb/input/xpad.c
@@ -110,7 +110,6 @@ struct usb_xpad {
110 dma_addr_t idata_dma; 110 dma_addr_t idata_dma;
111 111
112 char phys[65]; /* physical device path */ 112 char phys[65]; /* physical device path */
113 int open_count; /* reference count */
114}; 113};
115 114
116/* 115/*
@@ -197,14 +196,9 @@ static int xpad_open (struct input_dev *dev)
197{ 196{
198 struct usb_xpad *xpad = dev->private; 197 struct usb_xpad *xpad = dev->private;
199 198
200 if (xpad->open_count++)
201 return 0;
202
203 xpad->irq_in->dev = xpad->udev; 199 xpad->irq_in->dev = xpad->udev;
204 if (usb_submit_urb(xpad->irq_in, GFP_KERNEL)) { 200 if (usb_submit_urb(xpad->irq_in, GFP_KERNEL))
205 xpad->open_count--;
206 return -EIO; 201 return -EIO;
207 }
208 202
209 return 0; 203 return 0;
210} 204}
@@ -213,8 +207,7 @@ static void xpad_close (struct input_dev *dev)
213{ 207{
214 struct usb_xpad *xpad = dev->private; 208 struct usb_xpad *xpad = dev->private;
215 209
216 if (!--xpad->open_count) 210 usb_kill_urb(xpad->irq_in);
217 usb_kill_urb(xpad->irq_in);
218} 211}
219 212
220static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id) 213static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id)