Skip to content

Commit

Permalink
mtd: nand: update mtd_to_nand()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Boris BREZILLON authored and Brian Norris committed Dec 18, 2015
1 parent 442f201 commit 2d3b77b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2d3b77b

Please sign in to comment.