mtd: nand: make use of mtd_to_nand() in NAND drivers
[deliverable/linux.git] / drivers / mtd / nand / txx9ndfmc.c
index 8572519b8441b98fa94d55dda5b6d9c35bece1ea..ff9afb1eb3adb58cf1293b9f801bbbc8fe65c891 100644 (file)
@@ -79,7 +79,7 @@ struct txx9ndfmc_drvdata {
 
 static struct platform_device *mtd_to_platdev(struct mtd_info *mtd)
 {
-       struct nand_chip *chip = mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        struct txx9ndfmc_priv *txx9_priv = chip->priv;
        return txx9_priv->dev;
 }
@@ -135,7 +135,7 @@ static void txx9ndfmc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 static void txx9ndfmc_cmd_ctrl(struct mtd_info *mtd, int cmd,
                               unsigned int ctrl)
 {
-       struct nand_chip *chip = mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        struct txx9ndfmc_priv *txx9_priv = chip->priv;
        struct platform_device *dev = txx9_priv->dev;
        struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev);
@@ -175,7 +175,7 @@ static int txx9ndfmc_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
                                   uint8_t *ecc_code)
 {
        struct platform_device *dev = mtd_to_platdev(mtd);
-       struct nand_chip *chip = mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        int eccbytes;
        u32 mcr = txx9ndfmc_read(dev, TXX9_NDFMCR);
 
@@ -195,7 +195,7 @@ static int txx9ndfmc_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
 static int txx9ndfmc_correct_data(struct mtd_info *mtd, unsigned char *buf,
                unsigned char *read_ecc, unsigned char *calc_ecc)
 {
-       struct nand_chip *chip = mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        int eccsize;
        int corrected = 0;
        int stat;
@@ -257,7 +257,7 @@ static void txx9ndfmc_initialize(struct platform_device *dev)
 
 static int txx9ndfmc_nand_scan(struct mtd_info *mtd)
 {
-       struct nand_chip *chip = mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        int ret;
 
        ret = nand_scan_ident(mtd, 1, NULL);
@@ -391,7 +391,7 @@ static int __exit txx9ndfmc_remove(struct platform_device *dev)
 
                if (!mtd)
                        continue;
-               chip = mtd->priv;
+               chip = mtd_to_nand(mtd);
                txx9_priv = chip->priv;
 
                nand_release(mtd);
This page took 0.027536 seconds and 5 git commands to generate.