mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Use it where appropriate.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
 
 static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
 {
-       struct nand_chip *chip = (struct nand_chip *)mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        struct spinand_info *info = (struct spinand_info *)chip->priv;
        struct spinand_state *state = (struct spinand_state *)info->priv;
 
 static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
                            int column, int page)
 {
-       struct nand_chip *chip = (struct nand_chip *)mtd->priv;
+       struct nand_chip *chip = mtd_to_nand(mtd);
        struct spinand_info *info = (struct spinand_info *)chip->priv;
        struct spinand_state *state = (struct spinand_state *)info->priv;