ar71xx: convert mikrotik routerboard support to UBI
[openwrt/openwrt.git] / target / linux / ar71xx / files / drivers / mtd / nand / rb4xx_nand.c
index a379900fe32baa095c08b1c7cfdb534498fc58fd..96ec5dd1e59650cbd12462336fc2401f1dde9cb3 100644 (file)
@@ -65,7 +65,7 @@ static struct mtd_partition rb4xx_nand_partitions[] = {
                .size   = (4 * 1024 * 1024) - (256 * 1024),
        },
        {
-               .name   = "rootfs",
+               .name   = "ubi",
                .offset = MTDPART_OFS_NXTBLK,
                .size   = MTDPART_SIZ_FULL,
        },
@@ -107,7 +107,7 @@ static unsigned char rb4xx_nand_read_byte(struct mtd_info *mtd)
        unsigned char data = 0;
        int err;
 
-       err = rb4xx_cpld_read(&data, NULL, 1);
+       err = rb4xx_cpld_read(&data, 1);
        if (err) {
                pr_err("rb4xx_nand: read data failed, err=%d\n", err);
                data = 0xff;
@@ -131,12 +131,12 @@ static void rb4xx_nand_read_buf(struct mtd_info *mtd, unsigned char *buf,
 {
        int err;
 
-       err = rb4xx_cpld_read(buf, NULL, len);
+       err = rb4xx_cpld_read(buf, len);
        if (err)
                pr_err("rb4xx_nand: read buf failed, err=%d\n", err);
 }
 
-static int __devinit rb4xx_nand_probe(struct platform_device *pdev)
+static int rb4xx_nand_probe(struct platform_device *pdev)
 {
        struct rb4xx_nand_info  *info;
        int ret;
@@ -218,6 +218,7 @@ static int __devinit rb4xx_nand_probe(struct platform_device *pdev)
 
        info->chip.chip_delay   = 25;
        info->chip.ecc.mode     = NAND_ECC_SOFT;
+       info->chip.options = NAND_NO_SUBPAGE_WRITE;
 
        platform_set_drvdata(pdev, info);
 
@@ -261,7 +262,7 @@ err:
        return ret;
 }
 
-static int __devexit rb4xx_nand_remove(struct platform_device *pdev)
+static int rb4xx_nand_remove(struct platform_device *pdev)
 {
        struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
 
@@ -278,7 +279,7 @@ static int __devexit rb4xx_nand_remove(struct platform_device *pdev)
 
 static struct platform_driver rb4xx_nand_driver = {
        .probe  = rb4xx_nand_probe,
-       .remove = __devexit_p(rb4xx_nand_remove),
+       .remove = rb4xx_nand_remove,
        .driver = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,