Commit ad16780c authored by Martin Blumenstingl's avatar Martin Blumenstingl
Browse files

mtd: rawnand: intel: remove broken code



Drop the check for mtd->name as it's executed while the mtd variable is
always NULL. If some MTD name is needed then it should be validated by
the MTD core.

While here, also drop the NULL assignment to the mtd variable as it's
overwritten later on anyways and the NULL value is never read.

Fixes: 0b1039f0 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC")
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
parent 98c75ec7
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ static int ebu_nand_probe(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	struct ebu_nand_controller *ebu_host;
	struct nand_chip *nand;
	struct mtd_info *mtd = NULL;
	struct mtd_info *mtd;
	struct resource *res;
	char *resname;
	int ret;
@@ -647,10 +647,6 @@ static int ebu_nand_probe(struct platform_device *pdev)
	       ebu_host->ebu + EBU_ADDR_SEL(cs));

	nand_set_flash_node(&ebu_host->chip, dev->of_node);
	if (!mtd->name) {
		dev_err(ebu_host->dev, "NAND label property is mandatory\n");
		return -EINVAL;
	}

	mtd = nand_to_mtd(&ebu_host->chip);
	mtd->dev.parent = dev;