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

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

mtd: nand: orion: 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 432420c0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -85,11 +85,11 @@ static int __init orion_nand_probe(struct platform_device *pdev)
	u32 val = 0;
	u32 val = 0;


	nc = devm_kzalloc(&pdev->dev,
	nc = devm_kzalloc(&pdev->dev,
			sizeof(struct nand_chip) + sizeof(struct mtd_info),
			sizeof(struct nand_chip),
			GFP_KERNEL);
			GFP_KERNEL);
	if (!nc)
	if (!nc)
		return -ENOMEM;
		return -ENOMEM;
	mtd = (struct mtd_info *)(nc + 1);
	mtd = nand_to_mtd(nc);


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	io_base = devm_ioremap_resource(&pdev->dev, res);
	io_base = devm_ioremap_resource(&pdev->dev, res);