+#else
+ struct nand_chip *chip = mtd_to_nand(mtd);
+
+ return container_of(chip, struct rb750_nand_info, chip);
+#endif
+}
+
+static struct mtd_info *rbinfo_to_mtd(struct rb750_nand_info *nfc)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+ return &nfc->mtd;
+#else
+ return nand_to_mtd(&nfc->chip);
+#endif