doc: mtd: nand: update examples to use mtd_to_nand()
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Tue Jan 12 15:59:08 PST 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1e6460abf739310fe695bafac30c2be39d18c8f9
Commit: 1e6460abf739310fe695bafac30c2be39d18c8f9
Parent: c291b3c3527fa962f53862426e0e4258d7bd8269
Author: Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Mon Nov 16 14:37:36 2015 +0100
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Nov 19 11:21:04 2015 -0800
doc: mtd: nand: update examples to use mtd_to_nand()
mtd_to_nand() has been introduced to hide accesses to mtd->priv.
All NAND controller drivers should use it instead of directly accessing
the ->priv field.
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
Documentation/DocBook/mtdnand.tmpl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index 7da8f04..403a7ab 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -235,7 +235,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd)
<programlisting>
static void board_hwcontrol(struct mtd_info *mtd, int cmd)
{
- struct nand_chip *this = (struct nand_chip *) mtd->priv;
+ struct nand_chip *this = mtd_to_nand(mtd);
switch(cmd){
case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break;
case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break;
@@ -399,7 +399,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
<programlisting>
static void board_select_chip (struct mtd_info *mtd, int chip)
{
- struct nand_chip *this = (struct nand_chip *) mtd->priv;
+ struct nand_chip *this = mtd_to_nand(mtd);
/* Deselect all chips */
this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
More information about the linux-mtd-cvs
mailing list