mtd: gpmi: do not use the mtd->writesize
authorHuang Shijie <b32955@freescale.com>
Fri, 3 Jan 2014 03:01:41 +0000 (11:01 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 11 Mar 2014 05:42:30 +0000 (22:42 -0700)
The nfc_geo->payload_size is equal to the mtd->writesize now,
use the nfc_geo->payload_size to replace the mtd->writesize.

This patch makes preparation for the gpmi's subpage read support.
In the subpage support, the nfc_geo->payload_size maybe smaller then
the mtd->writesize.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/gpmi-nand/gpmi-nand.c

index ca6369fe91ff31fc89bd382dca62261774310ff0..5aaa7f541ea1dda47ae5ec52729ecf9bef80513f 100644 (file)
@@ -985,7 +985,7 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
        int           ret;
 
        dev_dbg(this->dev, "page number is : %d\n", page);
-       ret = read_page_prepare(this, buf, mtd->writesize,
+       ret = read_page_prepare(this, buf, nfc_geo->payload_size,
                                        this->payload_virt, this->payload_phys,
                                        nfc_geo->payload_size,
                                        &payload_virt, &payload_phys);
@@ -999,7 +999,7 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
 
        /* go! */
        ret = gpmi_read_page(this, payload_phys, auxiliary_phys);
-       read_page_end(this, buf, mtd->writesize,
+       read_page_end(this, buf, nfc_geo->payload_size,
                        this->payload_virt, this->payload_phys,
                        nfc_geo->payload_size,
                        payload_virt, payload_phys);
@@ -1041,7 +1041,7 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
                chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0];
        }
 
-       read_page_swap_end(this, buf, mtd->writesize,
+       read_page_swap_end(this, buf, nfc_geo->payload_size,
                        this->payload_virt, this->payload_phys,
                        nfc_geo->payload_size,
                        payload_virt, payload_phys);