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? */
{
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;
}
{
struct aiptek *aiptek = inputdev->private;
- if (--aiptek->openCount == 0) {
- usb_kill_urb(aiptek->urb);
- }
+ usb_kill_urb(aiptek->urb);
}
/***********************************************************************
AIPTEK_PACKET_LENGTH,
aiptek->data, aiptek->data_dma);
kfree(aiptek);
- aiptek = NULL;
}
}
#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");
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 */
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;
}
/*
{
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);
}
/*
*/
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);
{
struct ati_remote *ati_remote;
- down(&disconnect_sem);
-
ati_remote = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
if (!ati_remote) {
}
ati_remote_delete(ati_remote);
-
- up(&disconnect_sem);
}
/*
{
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;
}
{
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)
struct input_dev dev;
struct usb_device *usbdev;
struct urb *irq;
- int open;
int x, y;
int button;
int pressure;
{
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;
}
{
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)
struct urb *irq;
struct usb_device *udev;
struct input_dev input;
- int open;
char name[128];
char phys[64];
};
{
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;
}
{
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)
struct urb *irq;
struct usb_device *udev;
struct input_dev input;
- int open;
char name[128];
char phys[64];
};
{
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;
}
{
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,
unsigned char newleds;
char name[128];
char phys[64];
- int open;
unsigned char *new;
struct usb_ctrlrequest *cr;
{
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;
}
{
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)
struct usb_device *usbdev;
struct input_dev dev;
struct urb *irq;
- int open;
signed char *data;
dma_addr_t data_dma;
{
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;
}
{
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)
struct urb *irq;
struct wacom_features *features;
int tool[2];
- int open;
__u32 serial[2];
char phys[32];
};
{
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;
}
{
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)
dma_addr_t idata_dma;
char phys[65]; /* physical device path */
- int open_count; /* reference count */
};
/*
{
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;
}
{
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)