Merge branches 'release', 'asus', 'sony-laptop' and 'thinkpad' into release
[pandora-kernel.git] / drivers / mtd / nand / sharpsl.c
index 2174365..033f880 100644 (file)
@@ -78,7 +78,7 @@ static struct mtd_partition sharpsl_nand_default_partition_info[] = {
 /*
  *     hardware specific access to control-lines
  *     ctrl:
- *     NAND_CNE: bit 0 -> bit 0 & 4
+ *     NAND_CNE: bit 0 -> bit 0 & 4
  *     NAND_CLE: bit 1 -> bit 1
  *     NAND_ALE: bit 2 -> bit 2
  *
@@ -92,7 +92,10 @@ static void sharpsl_nand_hwcontrol(struct mtd_info *mtd, int cmd,
                unsigned char bits = ctrl & 0x07;
 
                bits |= (ctrl & 0x01) << 4;
-               writeb((readb(FLASHCTL) & 0x17) | bits, FLASHCTL);
+
+               bits ^= 0x11;
+
+               writeb((readb(FLASHCTL) & ~0x17) | bits, FLASHCTL);
        }
 
        if (cmd != NAND_CMD_NONE)
@@ -162,7 +165,7 @@ static int __init sharpsl_nand_init(void)
                return -ENOMEM;
        }
 
-       /* map physical adress */
+       /* map physical address */
        sharpsl_io_base = ioremap(sharpsl_phys_base, 0x1000);
        if (!sharpsl_io_base) {
                printk("ioremap to access Sharp SL NAND chip failed\n");
@@ -237,11 +240,6 @@ static int __init sharpsl_nand_init(void)
                }
        }
 
-       if (machine_is_husky() || machine_is_borzoi() || machine_is_akita()) {
-               /* Need to use small eraseblock size for backward compatibility */
-               sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS;
-       }
-
        add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions);
 
        /* Return happy */
@@ -255,8 +253,6 @@ module_init(sharpsl_nand_init);
  */
 static void __exit sharpsl_nand_cleanup(void)
 {
-       struct nand_chip *this = (struct nand_chip *)&sharpsl_mtd[1];
-
        /* Release resources, unregister device */
        nand_release(sharpsl_mtd);