mtd: rawnand: Pass a nand_chip object to ecc->correct()
[linux-2.6-block.git] / drivers / mtd / nand / raw / lpc32xx_slc.c
index a4e8b7e7513516c91520814c49519e1259f8f779..d5cb1b40a23587c55206c420a71aa84a44412d53 100644 (file)
@@ -337,7 +337,7 @@ static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host)
 /*
  * Prepares SLC for transfers with H/W ECC enabled
  */
-static void lpc32xx_nand_ecc_enable(struct mtd_info *mtd, int mode)
+static void lpc32xx_nand_ecc_enable(struct nand_chip *chip, int mode)
 {
        /* Hardware ECC is enabled automatically in hardware as needed */
 }
@@ -345,7 +345,7 @@ static void lpc32xx_nand_ecc_enable(struct mtd_info *mtd, int mode)
 /*
  * Calculates the ECC for the data
  */
-static int lpc32xx_nand_ecc_calculate(struct mtd_info *mtd,
+static int lpc32xx_nand_ecc_calculate(struct nand_chip *chip,
                                      const unsigned char *buf,
                                      unsigned char *code)
 {
@@ -639,7 +639,7 @@ static int lpc32xx_nand_read_page_syndrome(struct mtd_info *mtd,
        oobecc = chip->oob_poi + oobregion.offset;
 
        for (i = 0; i < chip->ecc.steps; i++) {
-               stat = chip->ecc.correct(mtd, buf, oobecc,
+               stat = chip->ecc.correct(chip, buf, oobecc,
                                         &tmpecc[i * chip->ecc.bytes]);
                if (stat < 0)
                        mtd->ecc_stats.failed++;
@@ -925,7 +925,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 
        /* Find NAND device */
        chip->dummy_controller.ops = &lpc32xx_nand_controller_ops;
-       res = nand_scan(mtd, 1);
+       res = nand_scan(chip, 1);
        if (res)
                goto release_dma;
 
@@ -956,9 +956,8 @@ static int lpc32xx_nand_remove(struct platform_device *pdev)
 {
        uint32_t tmp;
        struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
-       struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
 
-       nand_release(mtd);
+       nand_release(&host->nand_chip);
        dma_release_channel(host->dma_chan);
 
        /* Force CE high */