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