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

Commit ad99be47 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Boris Brezillon
Browse files

mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails



If 'mtd_device_parse_register()' fails, we still return 0 which mean
success.
Return the error code instead, as done in all the other error handling
paths.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 8b5c51a4
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -937,6 +937,11 @@ static int s3c_onenand_probe(struct platform_device *pdev)
	err = mtd_device_parse_register(mtd, NULL, NULL,
	err = mtd_device_parse_register(mtd, NULL, NULL,
					pdata ? pdata->parts : NULL,
					pdata ? pdata->parts : NULL,
					pdata ? pdata->nr_parts : 0);
					pdata ? pdata->nr_parts : 0);
	if (err) {
		dev_err(&pdev->dev, "failed to parse partitions and register the MTD device\n");
		onenand_release(mtd);
		return err;
	}


	platform_set_drvdata(pdev, mtd);
	platform_set_drvdata(pdev, mtd);