doc: mtd: nand: update examples to use mtd_to_nand()
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Mon, 16 Nov 2015 13:37:36 +0000 (14:37 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 19 Nov 2015 19:21:04 +0000 (11:21 -0800)
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>
Documentation/DocBook/mtdnand.tmpl

index 7da8f0402af50b880b27055122c8128bdc6fb8c7..403a7abfc2bca4491b01d0af6a2f36a7d4845ef7 100644 (file)
@@ -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 &amp;= ~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 &amp;= ~BOARD_NAND_ADDR_MASK;