diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-12-01 14:03:04 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-12-08 23:24:36 +0300 |
commit | 4bd4ebcc540c35d4477b098cf26394f976551464 (patch) | |
tree | 2ceb0ef03c53f3f65d881a1d15d2445b602bdb38 /drivers/mtd/nand/bcm47xxnflash | |
parent | a83dfa92850e521dfb6485ad4aa3c7c1fb52f06e (diff) | |
download | linux-4bd4ebcc540c35d4477b098cf26394f976551464.tar.xz |
mtd: nand: make use of mtd_to_nand() in NAND drivers
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all NAND drivers to use it.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/bcm47xxnflash')
-rw-r--r-- | drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c index 592befc7ffa1..e5b2e48658c4 100644 --- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c @@ -89,7 +89,7 @@ static int bcm47xxnflash_ops_bcm4706_poll(struct bcma_drv_cc *cc) static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, int len) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; u32 ctlcode; @@ -139,7 +139,7 @@ static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, const uint8_t *buf, int len) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; struct bcma_drv_cc *cc = b47n->cc; @@ -173,7 +173,7 @@ static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, static void bcm47xxnflash_ops_bcm4706_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; u32 code = 0; @@ -199,7 +199,7 @@ static void bcm47xxnflash_ops_bcm4706_select_chip(struct mtd_info *mtd, static int bcm47xxnflash_ops_bcm4706_dev_ready(struct mtd_info *mtd) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); @@ -216,7 +216,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, unsigned command, int column, int page_addr) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; struct bcma_drv_cc *cc = b47n->cc; u32 ctlcode; @@ -312,7 +312,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct mtd_info *mtd) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; struct bcma_drv_cc *cc = b47n->cc; u32 tmp = 0; @@ -341,7 +341,7 @@ static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct mtd_info *mtd) static void bcm47xxnflash_ops_bcm4706_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; switch (b47n->curr_command) { @@ -357,7 +357,7 @@ static void bcm47xxnflash_ops_bcm4706_read_buf(struct mtd_info *mtd, static void bcm47xxnflash_ops_bcm4706_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) { - struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; + struct nand_chip *nand_chip = mtd_to_nand(mtd); struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; switch (b47n->curr_command) { |