#include <linux/mtd/flashchip.h>
 #include <linux/mtd/bbm.h>
 #include <linux/mtd/jedec.h>
+#include <linux/mtd/nand.h>
 #include <linux/mtd/onfi.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
 int nand_op_parser_exec_op(struct nand_chip *chip,
                           const struct nand_op_parser *parser,
                           const struct nand_operation *op, bool check_only);
+
 /**
  * struct nand_controller_ops - Controller operations
  *
 
 /**
  * struct nand_chip - NAND Private Flash Chip Data
- * @mtd:               MTD device registered to the MTD framework
+ * @base:              Inherit from the generic NAND device
  * @legacy:            All legacy fields/hooks. If you develop a new driver,
  *                     don't even try to use any of these fields/hooks, and if
  *                     you're modifying an existing driver that is using those
  */
 
 struct nand_chip {
-       struct mtd_info mtd;
+       struct nand_device base;
 
        struct nand_legacy legacy;
 
 
 static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
 {
-       return container_of(mtd, struct nand_chip, mtd);
+       return container_of(mtd, struct nand_chip, base.mtd);
 }
 
 static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)
 {
-       return &chip->mtd;
+       return &chip->base.mtd;
 }
 
 static inline void *nand_get_controller_data(struct nand_chip *chip)