Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / megaraid / megaraid_mm.c
index e12024d..e8f534f 100644 (file)
@@ -10,7 +10,7 @@
  *        2 of the License, or (at your option) any later version.
  *
  * FILE                : megaraid_mm.c
- * Version     : v2.20.2.5 (Jan 21 2005)
+ * Version     : v2.20.2.6 (Mar 7 2005)
  *
  * Common management module
  */
@@ -43,8 +43,7 @@ static void mraid_mm_free_adp_resources(mraid_mmadp_t *);
 static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *);
 
 #ifdef CONFIG_COMPAT
-static int mraid_mm_compat_ioctl(unsigned int, unsigned int, unsigned long,
-               struct file *);
+static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned long);
 #endif
 
 MODULE_AUTHOR("LSI Logic Corporation");
@@ -61,7 +60,7 @@ EXPORT_SYMBOL(mraid_mm_unregister_adp);
 EXPORT_SYMBOL(mraid_mm_adapter_app_handle);
 
 static int majorno;
-static uint32_t drvr_ver       = 0x02200201;
+static uint32_t drvr_ver       = 0x02200206;
 
 static int adapters_count_g;
 static struct list_head adapters_list_g;
@@ -71,6 +70,9 @@ static wait_queue_head_t wait_q;
 static struct file_operations lsi_fops = {
        .open   = mraid_mm_open,
        .ioctl  = mraid_mm_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = mraid_mm_compat_ioctl,
+#endif
        .owner  = THIS_MODULE,
 };
 
@@ -896,10 +898,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
 
        adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL);
 
-       if (!adapter) {
-               rval = -ENOMEM;
-               goto memalloc_error;
-       }
+       if (!adapter)
+               return -ENOMEM;
 
        memset(adapter, 0, sizeof(mraid_mmadp_t));
 
@@ -993,17 +993,13 @@ pthru_dma_pool_error:
 
 memalloc_error:
 
-       if (adapter->kioc_list)
-               kfree(adapter->kioc_list);
-
-       if (adapter->mbox_list)
-               kfree(adapter->mbox_list);
+       kfree(adapter->kioc_list);
+       kfree(adapter->mbox_list);
 
        if (adapter->pthru_dma_pool)
                pci_pool_destroy(adapter->pthru_dma_pool);
 
-       if (adapter)
-               kfree(adapter);
+       kfree(adapter);
 
        return rval;
 }
@@ -1155,7 +1151,6 @@ mraid_mm_free_adp_resources(mraid_mmadp_t *adp)
        }
 
        kfree(adp->kioc_list);
-
        kfree(adp->mbox_list);
 
        pci_pool_destroy(adp->pthru_dma_pool);
@@ -1215,8 +1210,6 @@ mraid_mm_init(void)
 
        INIT_LIST_HEAD(&adapters_list_g);
 
-       register_ioctl32_conversion(MEGAIOCCMD, mraid_mm_compat_ioctl);
-
        return 0;
 }
 
@@ -1225,13 +1218,15 @@ mraid_mm_init(void)
  * mraid_mm_compat_ioctl       : 32bit to 64bit ioctl conversion routine
  */
 #ifdef CONFIG_COMPAT
-static int
-mraid_mm_compat_ioctl(unsigned int fd, unsigned int cmd,
-                       unsigned long arg, struct file *filep)
+static long
+mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
+                     unsigned long arg)
 {
-       struct inode *inode = filep->f_dentry->d_inode;
+       int err;
+
+       err = mraid_mm_ioctl(NULL, filep, cmd, arg);
 
-       return mraid_mm_ioctl(inode, filep, cmd, arg);
+       return err;
 }
 #endif
 
@@ -1244,7 +1239,6 @@ mraid_mm_exit(void)
        con_log(CL_DLEVEL1 , ("exiting common mod\n"));
 
        unregister_chrdev(majorno, "megadev");
-       unregister_ioctl32_conversion(MEGAIOCCMD);
 }
 
 module_init(mraid_mm_init);