Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a723bf6a authored by Boris Brezillon's avatar Boris Brezillon Committed by Brian Norris
Browse files

mtd: nand: socrates: use the mtd instance embedded in struct nand_chip



struct nand_chip now embeds an mtd device. Make use of this mtd instance.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 17dd20bd
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@

struct socrates_nand_host {
	struct nand_chip	nand_chip;
	struct mtd_info		mtd;
	void __iomem		*io_base;
	struct device		*dev;
};
@@ -159,8 +158,8 @@ static int socrates_nand_probe(struct platform_device *ofdev)
		return -EIO;
	}

	mtd = &host->mtd;
	nand_chip = &host->nand_chip;
	mtd = nand_to_mtd(nand_chip);
	host->dev = &ofdev->dev;

	nand_chip->priv = host;		/* link the private data structures */
@@ -216,7 +215,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
static int socrates_nand_remove(struct platform_device *ofdev)
{
	struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev);
	struct mtd_info *mtd = &host->mtd;
	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);

	nand_release(mtd);