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/cafe_nand.c | |
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/cafe_nand.c')
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index cce3ac4939b6..77c92f1b985f 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c @@ -101,7 +101,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; static int cafe_device_ready(struct mtd_info *mtd) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000); uint32_t irqs = cafe_readl(cafe, NAND_IRQ); @@ -118,7 +118,7 @@ static int cafe_device_ready(struct mtd_info *mtd) static void cafe_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; if (usedma) @@ -134,7 +134,7 @@ static void cafe_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) static void cafe_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; if (usedma) @@ -149,7 +149,7 @@ static void cafe_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) static uint8_t cafe_read_byte(struct mtd_info *mtd) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; uint8_t d; @@ -162,7 +162,7 @@ static uint8_t cafe_read_byte(struct mtd_info *mtd) static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, int column, int page_addr) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; int adrbytes = 0; uint32_t ctl1; @@ -318,7 +318,7 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, static void cafe_select_chip(struct mtd_info *mtd, int chipnr) { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; cafe_dev_dbg(&cafe->pdev->dev, "select_chip %d\n", chipnr); @@ -334,7 +334,7 @@ static void cafe_select_chip(struct mtd_info *mtd, int chipnr) static irqreturn_t cafe_nand_interrupt(int irq, void *id) { struct mtd_info *mtd = id; - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; uint32_t irqs = cafe_readl(cafe, NAND_IRQ); cafe_writel(cafe, irqs & ~0x90000000, NAND_IRQ); @@ -800,7 +800,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, static void cafe_nand_remove(struct pci_dev *pdev) { struct mtd_info *mtd = pci_get_drvdata(pdev); - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; /* Disable NAND IRQ in global IRQ mask register */ @@ -828,7 +828,7 @@ static int cafe_nand_resume(struct pci_dev *pdev) { uint32_t ctrl; struct mtd_info *mtd = pci_get_drvdata(pdev); - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); struct cafe_priv *cafe = chip->priv; /* Start off by resetting the NAND controller completely */ |