From 4bd4ebcc540c35d4477b098cf26394f976551464 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Tue, 1 Dec 2015 12:03:04 +0100 Subject: 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 Signed-off-by: Brian Norris --- drivers/mtd/nand/cafe_nand.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/mtd/nand/cafe_nand.c') 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 */ -- cgit v1.2.3