if (!dn)
return 0;
- /* MTD can automatically handle DT partitions, etc. */
- mtd_set_of_node(nand_to_mtd(chip), dn);
-
if (of_get_nand_bus_width(dn) == 16)
chip->options |= NAND_BUSWIDTH_16;
* flash device
* @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
* flash device.
- * @flash_node: [BOARDSPECIFIC] device node describing this instance
* @read_byte: [REPLACEABLE] read one byte from the chip
* @read_word: [REPLACEABLE] read one word from the chip
* @write_byte: [REPLACEABLE] write a single byte to the chip on the
void __iomem *IO_ADDR_R;
void __iomem *IO_ADDR_W;
- struct device_node *flash_node;
-
uint8_t (*read_byte)(struct mtd_info *mtd);
u16 (*read_word)(struct mtd_info *mtd);
void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
static inline void nand_set_flash_node(struct nand_chip *chip,
struct device_node *np)
{
- chip->flash_node = np;
+ mtd_set_of_node(&chip->mtd, np);
}
static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
{
- return chip->flash_node;
+ return mtd_get_of_node(&chip->mtd);
}
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)