Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | Subject | Re: [ANNOUNCE]: version 2.00.3 megaraid driver for 2.4.x and 2.5.67 kernels | From | James Bottomley <> | Date | 17 Apr 2003 12:25:44 -0500 |
| |
OK, I think the attached patch fixes the try_module_get problem and also sweeps up a compile warning issue I ran into on pa-risc.
Does this look OK to everyone?
James
# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1044 -> 1.1046 # drivers/scsi/megaraid.c 1.38 -> 1.40 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/04/17 jejb@raven.il.steeleye.com 1.1045 # Fix megaraid compile warnings # -------------------------------------------- # 03/04/17 jejb@raven.il.steeleye.com 1.1046 # Fix megaraid module ownership # # Move to using the .owner field of fops # -------------------------------------------- # diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c --- a/drivers/scsi/megaraid.c Thu Apr 17 12:23:35 2003 +++ b/drivers/scsi/megaraid.c Thu Apr 17 12:23:35 2003 @@ -34,6 +34,7 @@ #include <linux/fs.h> #include <linux/blk.h> #include <asm/uaccess.h> +#include <asm/io.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/module.h> @@ -87,9 +88,9 @@ * The File Operations structure for the serial/ioctl interface of the driver */ static struct file_operations megadev_fops = { + .owner = THIS_MODULE, .ioctl = megadev_ioctl, .open = megadev_open, - .release = megadev_close, }; /* @@ -4039,9 +4040,6 @@ */ if( !capable(CAP_SYS_ADMIN) ) return -EACCES; - if (!try_module_get(THIS_MODULE)) { - return -ENXIO; - } return 0; } @@ -4635,14 +4633,6 @@ } } - return 0; -} - - -static int -megadev_close (struct inode *inode, struct file *filep) -{ - module_put(THIS_MODULE); return 0; } | ![\](/images/icornerr.gif) |