diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-05-29 02:29:38 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-05-29 02:29:38 -0500 |
commit | 65cde54b8b0299d7e46b8705338b01d1e44a5eb0 (patch) | |
tree | 2aa4c3ab303fd19440c636edaecdb0976f9d82c7 | |
parent | 3108d42de4da0823feb37a55db62acdc01554625 (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>
-rw-r--r-- | drivers/usb/input/aiptek.c | 14 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote.c | 28 | ||||
-rw-r--r-- | drivers/usb/input/itmtouch.c | 10 | ||||
-rw-r--r-- | drivers/usb/input/kbtab.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/mtouchusb.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/touchkitusb.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/usbkbd.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/usbmouse.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/wacom.c | 11 | ||||
-rw-r--r-- | drivers/usb/input/xpad.c | 11 |
10 files changed, 23 insertions, 106 deletions
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index 68d9d281386..a6921856a11 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c @@ -324,7 +324,6 @@ struct aiptek { struct aiptek_settings curSetting; /* tablet's current programmable */ struct aiptek_settings newSetting; /* ... and new param settings */ unsigned int ifnum; /* interface number for IO */ - int openCount; /* module use counter */ int diagnostic; /* tablet diagnostic codes */ unsigned long eventCount; /* event count */ int inDelay; /* jitter: in jitter delay? */ @@ -814,15 +813,9 @@ static int aiptek_open(struct input_dev *inputdev) { struct aiptek *aiptek = inputdev->private; - if (aiptek->openCount++ > 0) { - return 0; - } - aiptek->urb->dev = aiptek->usbdev; - if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0) { - aiptek->openCount--; + if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0) return -EIO; - } return 0; } @@ -834,9 +827,7 @@ static void aiptek_close(struct input_dev *inputdev) { struct aiptek *aiptek = inputdev->private; - if (--aiptek->openCount == 0) { - usb_kill_urb(aiptek->urb); - } + usb_kill_urb(aiptek->urb); } /*********************************************************************** @@ -2252,7 +2243,6 @@ static void aiptek_disconnect(struct usb_interface *intf) AIPTEK_PACKET_LENGTH, aiptek->data, aiptek->data_dma); kfree(aiptek); - aiptek = NULL; } } diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index cf45add8171..db95c975952 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c @@ -113,11 +113,11 @@ #define DATA_BUFSIZE 63 /* size of URB data buffers */ #define ATI_INPUTNUM 1 /* Which input device to register as */ -static unsigned long channel_mask = 0; +static unsigned long channel_mask; module_param(channel_mask, ulong, 0444); MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore"); -static int debug = 0; +static int debug; module_param(debug, int, 0444); MODULE_PARM_DESC(debug, "Enable extra debug messages and information"); @@ -174,8 +174,6 @@ struct ati_remote { dma_addr_t inbuf_dma; dma_addr_t outbuf_dma; - int open; /* open counter */ - unsigned char old_data[2]; /* Detect duplicate events */ unsigned long old_jiffies; unsigned long acc_jiffies; /* handle acceleration */ @@ -328,25 +326,16 @@ static void ati_remote_dump(unsigned char *data, unsigned int len) static int ati_remote_open(struct input_dev *inputdev) { struct ati_remote *ati_remote = inputdev->private; - int retval = 0; - - down(&disconnect_sem); - - if (ati_remote->open++) - goto exit; /* On first open, submit the read urb which was set up previously. */ ati_remote->irq_urb->dev = ati_remote->udev; if (usb_submit_urb(ati_remote->irq_urb, GFP_KERNEL)) { dev_err(&ati_remote->interface->dev, "%s: usb_submit_urb failed!\n", __FUNCTION__); - ati_remote->open--; - retval = -EIO; + return -EIO; } -exit: - up(&disconnect_sem); - return retval; + return 0; } /* @@ -356,8 +345,7 @@ static void ati_remote_close(struct input_dev *inputdev) { struct ati_remote *ati_remote = inputdev->private; - if (!--ati_remote->open) - usb_kill_urb(ati_remote->irq_urb); + usb_kill_urb(ati_remote->irq_urb); } /* @@ -602,8 +590,6 @@ static void ati_remote_irq_in(struct urb *urb, struct pt_regs *regs) */ static void ati_remote_delete(struct ati_remote *ati_remote) { - if (!ati_remote) return; - if (ati_remote->irq_urb) usb_kill_urb(ati_remote->irq_urb); @@ -799,8 +785,6 @@ static void ati_remote_disconnect(struct usb_interface *interface) { struct ati_remote *ati_remote; - down(&disconnect_sem); - ati_remote = usb_get_intfdata(interface); usb_set_intfdata(interface, NULL); if (!ati_remote) { @@ -809,8 +793,6 @@ static void ati_remote_disconnect(struct usb_interface *interface) } ati_remote_delete(ati_remote); - - up(&disconnect_sem); } /* diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 5122a7f701a..47dec6a1b34 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -137,15 +137,10 @@ static int itmtouch_open(struct input_dev *input) { struct itmtouch_dev *itmtouch = input->private; - if (itmtouch->users++) - return 0; - itmtouch->readurb->dev = itmtouch->usbdev; - if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL)) { - itmtouch->users--; + if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL)) return -EIO; - } return 0; } @@ -154,8 +149,7 @@ static void itmtouch_close(struct input_dev *input) { struct itmtouch_dev *itmtouch = input->private; - if (!--itmtouch->users) - usb_kill_urb(itmtouch->readurb); + usb_kill_urb(itmtouch->readurb); } static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id *id) diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c index fff5753b16c..d2f0f90a9bc 100644 --- a/drivers/usb/input/kbtab.c +++ b/drivers/usb/input/kbtab.c @@ -36,7 +36,6 @@ struct kbtab { struct input_dev dev; struct usb_device *usbdev; struct urb *irq; - int open; int x, y; int button; int pressure; @@ -105,14 +104,9 @@ static int kbtab_open(struct input_dev *dev) { struct kbtab *kbtab = dev->private; - if (kbtab->open++) - return 0; - kbtab->irq->dev = kbtab->usbdev; - if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) { - kbtab->open--; + if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) return -EIO; - } return 0; } @@ -121,8 +115,7 @@ static void kbtab_close(struct input_dev *dev) { struct kbtab *kbtab = dev->private; - if (!--kbtab->open) - usb_kill_urb(kbtab->irq); + usb_kill_urb(kbtab->irq); } static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *id) diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index ec1dd6278f7..09b5cc7c66d 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -98,7 +98,6 @@ struct mtouch_usb { struct urb *irq; struct usb_device *udev; struct input_dev input; - int open; char name[128]; char phys[64]; }; @@ -155,15 +154,10 @@ static int mtouchusb_open(struct input_dev *input) { struct mtouch_usb *mtouch = input->private; - if (mtouch->open++) - return 0; - mtouch->irq->dev = mtouch->udev; - if (usb_submit_urb(mtouch->irq, GFP_ATOMIC)) { - mtouch->open--; + if (usb_submit_urb(mtouch->irq, GFP_ATOMIC)) return -EIO; - } return 0; } @@ -172,8 +166,7 @@ static void mtouchusb_close(struct input_dev *input) { struct mtouch_usb *mtouch = input->private; - if (!--mtouch->open) - usb_kill_urb(mtouch->irq); + usb_kill_urb(mtouch->irq); } static int mtouchusb_alloc_buffers(struct usb_device *udev, struct mtouch_usb *mtouch) diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index a71f1bbd0a1..386595ee21c 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -69,7 +69,6 @@ struct touchkit_usb { struct urb *irq; struct usb_device *udev; struct input_dev input; - int open; char name[128]; char phys[64]; }; @@ -134,15 +133,10 @@ static int touchkit_open(struct input_dev *input) { struct touchkit_usb *touchkit = input->private; - if (touchkit->open++) - return 0; - touchkit->irq->dev = touchkit->udev; - if (usb_submit_urb(touchkit->irq, GFP_ATOMIC)) { - touchkit->open--; + if (usb_submit_urb(touchkit->irq, GFP_ATOMIC)) return -EIO; - } return 0; } @@ -151,8 +145,7 @@ static void touchkit_close(struct input_dev *input) { struct touchkit_usb *touchkit = input->private; - if (!--touchkit->open) - usb_kill_urb(touchkit->irq); + usb_kill_urb(touchkit->irq); } static int touchkit_alloc_buffers(struct usb_device *udev, diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index 255b47a517b..f35db1974c4 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c @@ -72,7 +72,6 @@ struct usb_kbd { unsigned char newleds; char name[128]; char phys[64]; - int open; unsigned char *new; struct usb_ctrlrequest *cr; @@ -180,14 +179,9 @@ static int usb_kbd_open(struct input_dev *dev) { struct usb_kbd *kbd = dev->private; - if (kbd->open++) - return 0; - kbd->irq->dev = kbd->usbdev; - if (usb_submit_urb(kbd->irq, GFP_KERNEL)) { - kbd->open--; + if (usb_submit_urb(kbd->irq, GFP_KERNEL)) return -EIO; - } return 0; } @@ -196,8 +190,7 @@ static void usb_kbd_close(struct input_dev *dev) { struct usb_kbd *kbd = dev->private; - if (!--kbd->open) - usb_kill_urb(kbd->irq); + usb_kill_urb(kbd->irq); } static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index 8ca2811fd17..1ec41b5effe 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c @@ -51,7 +51,6 @@ struct usb_mouse { struct usb_device *usbdev; struct input_dev dev; struct urb *irq; - int open; signed char *data; dma_addr_t data_dma; @@ -101,14 +100,9 @@ static int usb_mouse_open(struct input_dev *dev) { struct usb_mouse *mouse = dev->private; - if (mouse->open++) - return 0; - mouse->irq->dev = mouse->usbdev; - if (usb_submit_urb(mouse->irq, GFP_KERNEL)) { - mouse->open--; + if (usb_submit_urb(mouse->irq, GFP_KERNEL)) return -EIO; - } return 0; } @@ -117,8 +111,7 @@ static void usb_mouse_close(struct input_dev *dev) { struct usb_mouse *mouse = dev->private; - if (!--mouse->open) - usb_kill_urb(mouse->irq); + usb_kill_urb(mouse->irq); } static int usb_mouse_probe(struct usb_interface * intf, const struct usb_device_id * id) diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index b3420e12ae4..e37d31b57b2 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c @@ -102,7 +102,6 @@ struct wacom { struct urb *irq; struct wacom_features *features; int tool[2]; - int open; __u32 serial[2]; char phys[32]; }; @@ -771,14 +770,9 @@ static int wacom_open(struct input_dev *dev) { struct wacom *wacom = dev->private; - if (wacom->open++) - return 0; - wacom->irq->dev = wacom->usbdev; - if (usb_submit_urb(wacom->irq, GFP_KERNEL)) { - wacom->open--; + if (usb_submit_urb(wacom->irq, GFP_KERNEL)) return -EIO; - } return 0; } @@ -787,8 +781,7 @@ static void wacom_close(struct input_dev *dev) { struct wacom *wacom = dev->private; - if (!--wacom->open) - usb_kill_urb(wacom->irq); + usb_kill_urb(wacom->irq); } static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index a8076ccc0b2..a7fa1b17dcf 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c @@ -110,7 +110,6 @@ struct usb_xpad { dma_addr_t idata_dma; char phys[65]; /* physical device path */ - int open_count; /* reference count */ }; /* @@ -197,14 +196,9 @@ static int xpad_open (struct input_dev *dev) { struct usb_xpad *xpad = dev->private; - if (xpad->open_count++) - return 0; - xpad->irq_in->dev = xpad->udev; - if (usb_submit_urb(xpad->irq_in, GFP_KERNEL)) { - xpad->open_count--; + if (usb_submit_urb(xpad->irq_in, GFP_KERNEL)) return -EIO; - } return 0; } @@ -213,8 +207,7 @@ static void xpad_close (struct input_dev *dev) { struct usb_xpad *xpad = dev->private; - if (!--xpad->open_count) - usb_kill_urb(xpad->irq_in); + usb_kill_urb(xpad->irq_in); } static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id) |