Commit 2a49c2e8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: removed MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT from driver that do not need it.

parent 7a4e572b
......@@ -1946,9 +1946,6 @@ static int auerswald_probe (struct usb_interface *intf,
if (intf->altsetting->desc.bInterfaceNumber != 0)
return -ENODEV;
/* prevent module unloading while sleeping */
MOD_INC_USE_COUNT;
/* allocate memory for our device and intialize it */
cp = kmalloc (sizeof(auerswald_t), GFP_KERNEL);
if (cp == NULL) {
......@@ -2066,7 +2063,6 @@ static int auerswald_probe (struct usb_interface *intf,
/* Error exit: clean up the memory */
pfail: auerswald_delete (cp);
MOD_DEC_USE_COUNT;
return -EIO;
}
......@@ -2138,9 +2134,6 @@ static void auerswald_disconnect (struct usb_interface *intf)
if (scp) scp->disconnect( scp);
}
}
/* The device releases this module */
MOD_DEC_USE_COUNT;
}
/* Descriptor for the devices which are served by this driver.
......
......@@ -467,8 +467,6 @@ brlvger_open(struct inode *inode, struct file *file)
n = devnum - BRLVGER_MINOR;
MOD_INC_USE_COUNT;
do {
down(&disconnect_sem);
priv = display_table[n];
......@@ -478,7 +476,6 @@ brlvger_open(struct inode *inode, struct file *file)
if (file->f_flags & O_NONBLOCK) {
dbg3("Failing non-blocking open: "
"device %d not connected", n);
MOD_DEC_USE_COUNT;
return -EAGAIN;
}
/* Blocking open. One global wait queue will
......@@ -490,7 +487,6 @@ brlvger_open(struct inode *inode, struct file *file)
!= NULL);
if(ret) {
dbg2("Interrupted wait for device %d", n);
MOD_DEC_USE_COUNT;
return ret;
}
}
......@@ -504,7 +500,7 @@ brlvger_open(struct inode *inode, struct file *file)
/* Only one process can open each device, no sharing. */
ret = -EBUSY;
if(priv->opened)
goto error;
goto out;
dbg("Opening display %d", priv->subminor);
......@@ -512,7 +508,7 @@ brlvger_open(struct inode *inode, struct file *file)
priv->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
if(!priv->intr_urb) {
err("Unable to allocate URB");
goto error;
goto out;
}
usb_fill_int_urb( priv->intr_urb, priv->dev,
usb_rcvintpipe(priv->dev,
......@@ -521,19 +517,19 @@ brlvger_open(struct inode *inode, struct file *file)
intr_callback, priv, priv->in_interrupt->bInterval);
if((ret = usb_submit_urb(priv->intr_urb, GFP_KERNEL)) <0){
err("Error %d while submitting URB", ret);
goto error;
goto out;
}
/* Set voltage */
if(brlvger_set_display_voltage(priv, raw_voltage) <0) {
err("Unable to set voltage");
goto error;
goto out;
}
/* Turn display on */
if((ret = brlvger_set_display_on_off(priv, 1)) <0) {
err("Error %d while turning display on", ret);
goto error;
goto out;
}
/* Mark as opened, so disconnect cannot free priv. */
......@@ -544,8 +540,6 @@ brlvger_open(struct inode *inode, struct file *file)
ret = 0;
goto out;
error:
MOD_DEC_USE_COUNT;
out:
up(&priv->open_sem);
return ret;
......@@ -577,8 +571,6 @@ brlvger_release(struct inode *inode, struct file *file)
up(&priv->open_sem);
}
MOD_DEC_USE_COUNT;
return 0;
}
......
......@@ -94,8 +94,6 @@ static int open_rio(struct inode *inode, struct file *file)
init_waitqueue_head(&rio->wait_q);
MOD_INC_USE_COUNT;
unlock_kernel();
info("Rio opened.");
......@@ -109,8 +107,6 @@ static int close_rio(struct inode *inode, struct file *file)
rio->isopen = 0;
MOD_DEC_USE_COUNT;
info("Rio closed.");
return 0;
}
......@@ -443,6 +439,7 @@ read_rio(struct file *file, char *buffer, size_t count, loff_t * ppos)
static struct
file_operations usb_rio_fops = {
.owner = THIS_MODULE,
.read = read_rio,
.write = write_rio,
.ioctl = ioctl_rio,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment