Commit 6c7a6731 authored by James Bottomley's avatar James Bottomley

Fix megaraid module ownership

Move to using the .owner field of fops
parent 676ae973
...@@ -88,9 +88,9 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; ...@@ -88,9 +88,9 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
* The File Operations structure for the serial/ioctl interface of the driver * The File Operations structure for the serial/ioctl interface of the driver
*/ */
static struct file_operations megadev_fops = { static struct file_operations megadev_fops = {
.owner = THIS_MODULE,
.ioctl = megadev_ioctl, .ioctl = megadev_ioctl,
.open = megadev_open, .open = megadev_open,
.release = megadev_close,
}; };
/* /*
...@@ -4040,9 +4040,6 @@ megadev_open (struct inode *inode, struct file *filep) ...@@ -4040,9 +4040,6 @@ megadev_open (struct inode *inode, struct file *filep)
*/ */
if( !capable(CAP_SYS_ADMIN) ) return -EACCES; if( !capable(CAP_SYS_ADMIN) ) return -EACCES;
if (!try_module_get(THIS_MODULE)) {
return -ENXIO;
}
return 0; return 0;
} }
...@@ -4640,14 +4637,6 @@ mega_n_to_m(void *arg, megacmd_t *mc) ...@@ -4640,14 +4637,6 @@ mega_n_to_m(void *arg, megacmd_t *mc)
} }
static int
megadev_close (struct inode *inode, struct file *filep)
{
module_put(THIS_MODULE);
return 0;
}
/* /*
* MEGARAID 'FW' commands. * MEGARAID 'FW' commands.
*/ */
......
...@@ -1054,7 +1054,6 @@ static int megadev_ioctl (struct inode *, struct file *, unsigned int, ...@@ -1054,7 +1054,6 @@ static int megadev_ioctl (struct inode *, struct file *, unsigned int,
unsigned long); unsigned long);
static int mega_m_to_n(void *, nitioctl_t *); static int mega_m_to_n(void *, nitioctl_t *);
static int mega_n_to_m(void *, megacmd_t *); static int mega_n_to_m(void *, megacmd_t *);
static int megadev_close (struct inode *, struct file *);
static int mega_init_scb (adapter_t *); static int mega_init_scb (adapter_t *);
......
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