提交 a83dfa92 编写于 作者: B Boris BREZILLON 提交者: Brian Norris

staging: mt29f_spinand: make use of mtd_to_nand()

mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Use it where appropriate.
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 862eba51
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
{ {
struct nand_chip *chip = (struct nand_chip *)mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
struct spinand_info *info = (struct spinand_info *)chip->priv; struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_state *state = (struct spinand_state *)info->priv; struct spinand_state *state = (struct spinand_state *)info->priv;
...@@ -744,7 +744,7 @@ static void spinand_reset(struct spi_device *spi_nand) ...@@ -744,7 +744,7 @@ static void spinand_reset(struct spi_device *spi_nand)
static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command, static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
int column, int page) int column, int page)
{ {
struct nand_chip *chip = (struct nand_chip *)mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
struct spinand_info *info = (struct spinand_info *)chip->priv; struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_state *state = (struct spinand_state *)info->priv; struct spinand_state *state = (struct spinand_state *)info->priv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册