vserver 1.9.5.x5
[linux-2.6.git] / drivers / mtd / nand / spia.c
index acf6fc8..b777c41 100644 (file)
@@ -8,7 +8,7 @@
  *                     to controllines (due to change in nand.c)
  *                     page_cache added
  *
- * $Id: spia.c,v 1.21 2003/07/11 15:12:29 dwmw2 Exp $
+ * $Id: spia.c,v 1.24 2004/11/04 12:53:10 gleixner Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -59,10 +59,10 @@ static int spia_fio_base = SPIA_FIO_BASE;
 static int spia_pedr = SPIA_PEDR;
 static int spia_peddr = SPIA_PEDDR;
 
-MODULE_PARM(spia_io_base, "i");
-MODULE_PARM(spia_fio_base, "i");
-MODULE_PARM(spia_pedr, "i");
-MODULE_PARM(spia_peddr, "i");
+module_param(spia_io_base, int, 0);
+module_param(spia_fio_base, int, 0);
+module_param(spia_pedr, int, 0);
+module_param(spia_peddr, int, 0);
 
 /*
  * Define partitions for flash device
@@ -132,8 +132,8 @@ int __init spia_init (void)
        (*(volatile unsigned char *) (spia_io_base + spia_peddr)) = 0x07;
 
        /* Set address of NAND IO lines */
-       this->IO_ADDR_R = spia_fio_base;
-       this->IO_ADDR_W = spia_fio_base;
+       this->IO_ADDR_R = (void __iomem *) spia_fio_base;
+       this->IO_ADDR_W = (void __iomem *) spia_fio_base;
        /* Set address of hardware control function */
        this->hwcontrol = spia_hwcontrol;
        /* 15 us command delay time */
@@ -145,14 +145,6 @@ int __init spia_init (void)
                return -ENXIO;
        }
 
-       /* Allocate memory for internal data buffer */
-       this->data_buf = kmalloc (sizeof(u_char) * (spia_mtd->oobblock + spia_mtd->oobsize), GFP_KERNEL);
-       if (!this->data_buf) {
-               printk ("Unable to allocate NAND data buffer for SPIA.\n");
-               kfree (spia_mtd);
-               return -ENOMEM;
-       }
-
        /* Register the partitions */
        add_mtd_partitions(spia_mtd, partition_info, NUM_PARTITIONS);
 
@@ -167,13 +159,8 @@ module_init(spia_init);
 #ifdef MODULE
 static void __exit spia_cleanup (void)
 {
-       struct nand_chip *this = (struct nand_chip *) &spia_mtd[1];
-
-       /* Unregister the device */
-       del_mtd_device (spia_mtd);
-
-       /* Free internal data buffer */
-       kfree (this->data_buf);
+       /* Release resources, unregister device */
+       nand_release (spia_mtd);
 
        /* Free the MTD device structure */
        kfree (spia_mtd);