vserver 1.9.5.x5
[linux-2.6.git] / drivers / mtd / nand / tx4925ndfmc.c
index 5f6a2f5..bba6888 100644 (file)
@@ -11,7 +11,7 @@
  * Derived from drivers/mtd/autcpu12.c
  *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
  *
- * $Id: tx4925ndfmc.c,v 1.3 2004/07/20 02:44:26 dwmw2 Exp $
+ * $Id: tx4925ndfmc.c,v 1.5 2004/10/05 13:50:20 gleixner Exp $
  *
  * Copyright (C) 2001 Toshiba Corporation 
  * 
@@ -340,8 +340,8 @@ int __init tx4925ndfmc_init (void)
        tx4925ndfmc_mtd->priv = this;
 
        /* Set address of NAND IO lines */
-       this->IO_ADDR_R = (unsigned long)&(tx4925_ndfmcptr->dtr);
-       this->IO_ADDR_W = (unsigned long)&(tx4925_ndfmcptr->dtr);
+       this->IO_ADDR_R = (void __iomem *)&(tx4925_ndfmcptr->dtr);
+       this->IO_ADDR_W = (void __iomem *)&(tx4925_ndfmcptr->dtr);
        this->hwcontrol = tx4925ndfmc_hwcontrol;
        this->enable_hwecc = tx4925ndfmc_enable_hwecc;
        this->calculate_ecc = tx4925ndfmc_readecc;
@@ -363,14 +363,6 @@ int __init tx4925ndfmc_init (void)
                goto out_ior;
        }
 
-       /* Allocate memory for internal data buffer */
-       this->data_buf = kmalloc (sizeof(u_char) * (tx4925ndfmc_mtd->oobblock + tx4925ndfmc_mtd->oobsize), GFP_KERNEL);
-       if (!this->data_buf) {
-               printk ("Unable to allocate NAND data buffer for RBTX4925.\n");
-               err = -ENOMEM;
-               goto out_ior;
-       }
-
        /* Register the partitions */
 #ifdef CONFIG_MTD_CMDLINE_PARTS
         {
@@ -391,14 +383,12 @@ int __init tx4925ndfmc_init (void)
                default: {
                        printk ("Unsupported SmartMedia device\n"); 
                        err = -ENXIO;
-                       goto out_buf;
+                       goto out_ior;
                }
        }
 #endif /* ifdef CONFIG_MTD_CMDLINE_PARTS */
        goto out;
 
-out_buf:
-       kfree (this->data_buf);    
 out_ior:
 out:
        return err;
@@ -412,16 +402,8 @@ module_init(tx4925ndfmc_init);
 #ifdef MODULE
 static void __exit tx4925ndfmc_cleanup (void)
 {
-       struct nand_chip *this = (struct nand_chip *) &tx4925ndfmc_mtd[1];
-
-       /* Unregister partitions */
-       del_mtd_partitions(tx4925ndfmc_mtd);
-       
-       /* Unregister the device */
-       del_mtd_device (tx4925ndfmc_mtd);
-
-       /* Free internal data buffers */
-       kfree (this->data_buf);
+       /* Release resources, unregister device */
+       nand_release (tx4925ndfmc_mtd);
 
        /* Free the MTD device structure */
        kfree (tx4925ndfmc_mtd);