Commit 080d66e9 authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal

mtd: rawnand: Use nand_to_mtd() in nand_{set,get}_flash_node()

Use the nand_to_mtd() helper to access chip->mtd as done everywhere
else.
Signed-off-by: default avatarBoris Brezillon <bbrezillon@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarFrieder Schrempf <frieder.schrempf@kontron.de>
parent 50919848
......@@ -1105,17 +1105,6 @@ struct nand_chip {
extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops;
static inline void nand_set_flash_node(struct nand_chip *chip,
struct device_node *np)
{
mtd_set_of_node(&chip->mtd, np);
}
static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
{
return mtd_get_of_node(&chip->mtd);
}
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
{
return container_of(mtd, struct nand_chip, mtd);
......@@ -1147,6 +1136,17 @@ static inline void *nand_get_manufacturer_data(struct nand_chip *chip)
return chip->manufacturer.priv;
}
static inline void nand_set_flash_node(struct nand_chip *chip,
struct device_node *np)
{
mtd_set_of_node(nand_to_mtd(chip), np);
}
static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
{
return mtd_get_of_node(nand_to_mtd(chip));
}
/*
* A helper for defining older NAND chips where the second ID byte fully
* defined the chip, including the geometry (chip size, eraseblock size, page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment