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

mtd: nand: add an mtd_to_nand() helper

Some drivers are retrieving the nand_chip pointer using the container_of
macro on a struct wrapping both the nand_chip and the mtd_info struct while
the standard way of retrieving this pointer is through mtd->priv.
Provide an helper to do that.
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 8005c49d
...@@ -719,6 +719,11 @@ struct nand_chip { ...@@ -719,6 +719,11 @@ struct nand_chip {
void *priv; void *priv;
}; };
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
{
return mtd->priv;
}
/* /*
* NAND Flash Manufacturer ID Codes * NAND Flash Manufacturer ID Codes
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册