diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-11-16 08:37:36 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-19 14:21:04 -0500 |
commit | 1e6460abf739310fe695bafac30c2be39d18c8f9 (patch) | |
tree | 18943bf9531d07f5e16333da84a798ca2b5a1b84 | |
parent | c291b3c3527fa962f53862426e0e4258d7bd8269 (diff) |
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@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | Documentation/DocBook/mtdnand.tmpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index 7da8f0402af5..403a7abfc2bc 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) | |||
235 | <programlisting> | 235 | <programlisting> |
236 | static void board_hwcontrol(struct mtd_info *mtd, int cmd) | 236 | static void board_hwcontrol(struct mtd_info *mtd, int cmd) |
237 | { | 237 | { |
238 | struct nand_chip *this = (struct nand_chip *) mtd->priv; | 238 | struct nand_chip *this = mtd_to_nand(mtd); |
239 | switch(cmd){ | 239 | switch(cmd){ |
240 | case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break; | 240 | case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break; |
241 | case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break; | 241 | 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) | |||
399 | <programlisting> | 399 | <programlisting> |
400 | static void board_select_chip (struct mtd_info *mtd, int chip) | 400 | static void board_select_chip (struct mtd_info *mtd, int chip) |
401 | { | 401 | { |
402 | struct nand_chip *this = (struct nand_chip *) mtd->priv; | 402 | struct nand_chip *this = mtd_to_nand(mtd); |
403 | 403 | ||
404 | /* Deselect all chips */ | 404 | /* Deselect all chips */ |
405 | this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; | 405 | this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; |