mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 10:50:53 +07:00
mtd: nand: update mtd_to_nand()
Now that all drivers are using the mtd instance embedded in the nand_chip struct we can safely update the mtd_to_nand() implementation to use the container_of macro instead of returning the content of mtd->priv. This will allow us to remove mtd->priv = chip assignments done in all NAND controller drivers. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
442f201b93
commit
2d3b77bac3
@ -734,7 +734,7 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
|
||||
|
||||
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
|
||||
{
|
||||
return mtd->priv;
|
||||
return container_of(mtd, struct nand_chip, mtd);
|
||||
}
|
||||
|
||||
static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)
|
||||
|
Loading…
Reference in New Issue
Block a user