diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-12-01 12:03:04 +0100 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-12-08 21:24:36 +0100 |
commit | 4bd4ebcc540c35d4477b098cf26394f976551464 (patch) | |
tree | 2ceb0ef03c53f3f65d881a1d15d2445b602bdb38 /drivers/mtd/nand/docg4.c | |
parent | staging: mt29f_spinand: make use of mtd_to_nand() (diff) | |
download | linux-4bd4ebcc540c35d4477b098cf26394f976551464.tar.xz linux-4bd4ebcc540c35d4477b098cf26394f976551464.zip |
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/docg4.c')
-rw-r--r-- | drivers/mtd/nand/docg4.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c index 408cf69b854b..da93d7f5c821 100644 --- a/drivers/mtd/nand/docg4.c +++ b/drivers/mtd/nand/docg4.c @@ -242,7 +242,7 @@ static inline void write_nop(void __iomem *docptr) static void docg4_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { int i; - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); uint16_t *p = (uint16_t *) buf; len >>= 1; @@ -253,7 +253,7 @@ static void docg4_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) static void docg4_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) { int i; - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); uint16_t *p = (uint16_t *) buf; len >>= 1; @@ -318,7 +318,7 @@ static void docg4_select_chip(struct mtd_info *mtd, int chip) * Select among multiple cascaded chips ("floors"). Multiple floors are * not yet supported, so the only valid non-negative value is 0. */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; @@ -337,7 +337,7 @@ static void reset(struct mtd_info *mtd) { /* full device reset */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; @@ -375,7 +375,7 @@ static int correct_data(struct mtd_info *mtd, uint8_t *buf, int page) * Up to four bitflips can be corrected. */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; int i, numerrs, errpos[4]; @@ -464,7 +464,7 @@ static int correct_data(struct mtd_info *mtd, uint8_t *buf, int page) static uint8_t docg4_read_byte(struct mtd_info *mtd) { - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; dev_dbg(doc->dev, "%s\n", __func__); @@ -545,7 +545,7 @@ static int pageprog(struct mtd_info *mtd) * internal buffer out to the flash array, or some such. */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; int retval = 0; @@ -582,7 +582,7 @@ static void sequence_reset(struct mtd_info *mtd) { /* common starting sequence for all operations */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; @@ -599,7 +599,7 @@ static void read_page_prologue(struct mtd_info *mtd, uint32_t docg4_addr) { /* first step in reading a page */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; @@ -626,7 +626,7 @@ static void write_page_prologue(struct mtd_info *mtd, uint32_t docg4_addr) { /* first step in writing a page */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; @@ -691,7 +691,7 @@ static void docg4_command(struct mtd_info *mtd, unsigned command, int column, { /* handle standard nand commands */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; uint32_t g4_addr = mtd_to_docg4_address(page_addr, column); @@ -874,7 +874,7 @@ static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand, static int docg4_erase_block(struct mtd_info *mtd, int page) { - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; uint16_t g4_page; @@ -1016,7 +1016,7 @@ static int __init read_factory_bbt(struct mtd_info *mtd) * update the memory-based bbt accordingly. */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; uint32_t g4_addr = mtd_to_docg4_address(DOCG4_FACTORY_BBT_PAGE, 0); uint8_t *buf; @@ -1089,7 +1089,7 @@ static int docg4_block_markbad(struct mtd_info *mtd, loff_t ofs) int ret, i; uint8_t *buf; - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; struct nand_bbt_descr *bbtd = nand->badblock_pattern; int page = (int)(ofs >> nand->page_shift); @@ -1202,7 +1202,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd) * things as well, such as call nand_set_defaults(). */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; mtd->size = DOCG4_CHIP_SIZE; @@ -1261,7 +1261,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd) static int __init read_id_reg(struct mtd_info *mtd) { - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; void __iomem *docptr = doc->virtadr; uint16_t id1, id2; @@ -1357,7 +1357,7 @@ static int __init probe_docg4(struct platform_device *pdev) iounmap(virtadr); if (mtd) { /* re-declarations avoid compiler warning */ - struct nand_chip *nand = mtd->priv; + struct nand_chip *nand = mtd_to_nand(mtd); struct docg4_priv *doc = nand->priv; nand_release(mtd); /* deletes partitions and mtd devices */ free_bch(doc->bch); |