diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-12-10 09:00:41 +0100 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2016-01-07 10:23:41 -0800 |
commit | d699ed250c07384840263bbbf69cf7b90b45470c (patch) | |
tree | 954ed7cebade37cdf63b87df7e00d6713545c2c1 /drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | |
parent | d9dccc68c5cae4ef7b4a617a93a87b11c6f0c53a (diff) | |
download | op-kernel-dev-d699ed250c07384840263bbbf69cf7b90b45470c.zip op-kernel-dev-d699ed250c07384840263bbbf69cf7b90b45470c.tar.gz |
mtd: nand: make use of nand_set/get_controller_data() helpers
New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
[Brian: fixed a few rebase conflicts]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c')
-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 6524780..f1da4ea 100644 --- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c @@ -90,7 +90,7 @@ static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, int len) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); u32 ctlcode; u32 *dest = (u32 *)buf; @@ -140,7 +140,7 @@ static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, const uint8_t *buf, int len) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); struct bcma_drv_cc *cc = b47n->cc; u32 ctlcode; @@ -174,7 +174,7 @@ static void bcm47xxnflash_ops_bcm4706_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); u32 code = 0; if (cmd == NAND_CMD_NONE) @@ -200,7 +200,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 = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); } @@ -217,7 +217,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, int page_addr) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); struct bcma_drv_cc *cc = b47n->cc; u32 ctlcode; int i; @@ -313,7 +313,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 = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); struct bcma_drv_cc *cc = b47n->cc; u32 tmp = 0; @@ -342,7 +342,7 @@ static void bcm47xxnflash_ops_bcm4706_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); switch (b47n->curr_command) { case NAND_CMD_READ0: @@ -358,7 +358,7 @@ static void bcm47xxnflash_ops_bcm4706_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) { struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; + struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); switch (b47n->curr_command) { case NAND_CMD_SEQIN: |