aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/ati_remote.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:38 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:38 -0400
commit65cde54b8b0299d7e46b8705338b01d1e44a5eb0 (patch)
tree2aa4c3ab303fd19440c636edaecdb0976f9d82c7 /drivers/usb/input/ati_remote.c
parent3108d42de4da0823feb37a55db62acdc01554625 (diff)
Input: remove user counters from drivers/usb/input since input
core takes care of calling open and close methods only when needed. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input/ati_remote.c')
-rw-r--r--drivers/usb/input/ati_remote.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index cf45add81713..db95c975952b 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -113,11 +113,11 @@
113#define DATA_BUFSIZE 63 /* size of URB data buffers */ 113#define DATA_BUFSIZE 63 /* size of URB data buffers */
114#define ATI_INPUTNUM 1 /* Which input device to register as */ 114#define ATI_INPUTNUM 1 /* Which input device to register as */
115 115
116static unsigned long channel_mask = 0; 116static unsigned long channel_mask;
117module_param(channel_mask, ulong, 0444); 117module_param(channel_mask, ulong, 0444);
118MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore"); 118MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore");
119 119
120static int debug = 0; 120static int debug;
121module_param(debug, int, 0444); 121module_param(debug, int, 0444);
122MODULE_PARM_DESC(debug, "Enable extra debug messages and information"); 122MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
123 123
@@ -174,8 +174,6 @@ struct ati_remote {
174 dma_addr_t inbuf_dma; 174 dma_addr_t inbuf_dma;
175 dma_addr_t outbuf_dma; 175 dma_addr_t outbuf_dma;
176 176
177 int open; /* open counter */
178
179 unsigned char old_data[2]; /* Detect duplicate events */ 177 unsigned char old_data[2]; /* Detect duplicate events */
180 unsigned long old_jiffies; 178 unsigned long old_jiffies;
181 unsigned long acc_jiffies; /* handle acceleration */ 179 unsigned long acc_jiffies; /* handle acceleration */
@@ -328,25 +326,16 @@ static void ati_remote_dump(unsigned char *data, unsigned int len)
328static int ati_remote_open(struct input_dev *inputdev) 326static int ati_remote_open(struct input_dev *inputdev)
329{ 327{
330 struct ati_remote *ati_remote = inputdev->private; 328 struct ati_remote *ati_remote = inputdev->private;
331 int retval = 0;
332
333 down(&disconnect_sem);
334
335 if (ati_remote->open++)
336 goto exit;
337 329
338 /* On first open, submit the read urb which was set up previously. */ 330 /* On first open, submit the read urb which was set up previously. */
339 ati_remote->irq_urb->dev = ati_remote->udev; 331 ati_remote->irq_urb->dev = ati_remote->udev;
340 if (usb_submit_urb(ati_remote->irq_urb, GFP_KERNEL)) { 332 if (usb_submit_urb(ati_remote->irq_urb, GFP_KERNEL)) {
341 dev_err(&ati_remote->interface->dev, 333 dev_err(&ati_remote->interface->dev,
342 "%s: usb_submit_urb failed!\n", __FUNCTION__); 334 "%s: usb_submit_urb failed!\n", __FUNCTION__);
343 ati_remote->open--; 335 return -EIO;
344 retval = -EIO;
345 } 336 }
346 337
347exit: 338 return 0;
348 up(&disconnect_sem);
349 return retval;
350} 339}
351 340
352/* 341/*
@@ -356,8 +345,7 @@ static void ati_remote_close(struct input_dev *inputdev)
356{ 345{
357 struct ati_remote *ati_remote = inputdev->private; 346 struct ati_remote *ati_remote = inputdev->private;
358 347
359 if (!--ati_remote->open) 348 usb_kill_urb(ati_remote->irq_urb);
360 usb_kill_urb(ati_remote->irq_urb);
361} 349}
362 350
363/* 351/*
@@ -602,8 +590,6 @@ static void ati_remote_irq_in(struct urb *urb, struct pt_regs *regs)
602 */ 590 */
603static void ati_remote_delete(struct ati_remote *ati_remote) 591static void ati_remote_delete(struct ati_remote *ati_remote)
604{ 592{
605 if (!ati_remote) return;
606
607 if (ati_remote->irq_urb) 593 if (ati_remote->irq_urb)
608 usb_kill_urb(ati_remote->irq_urb); 594 usb_kill_urb(ati_remote->irq_urb);
609 595
@@ -799,8 +785,6 @@ static void ati_remote_disconnect(struct usb_interface *interface)
799{ 785{
800 struct ati_remote *ati_remote; 786 struct ati_remote *ati_remote;
801 787
802 down(&disconnect_sem);
803
804 ati_remote = usb_get_intfdata(interface); 788 ati_remote = usb_get_intfdata(interface);
805 usb_set_intfdata(interface, NULL); 789 usb_set_intfdata(interface, NULL);
806 if (!ati_remote) { 790 if (!ati_remote) {
@@ -809,8 +793,6 @@ static void ati_remote_disconnect(struct usb_interface *interface)
809 } 793 }
810 794
811 ati_remote_delete(ati_remote); 795 ati_remote_delete(ati_remote);
812
813 up(&disconnect_sem);
814} 796}
815 797
816/* 798/*