[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a4e43e367b09184a7caa0bb9b9f1bc3fa8be54d1.1513230484.git.christophe.jaillet@wanadoo.fr>
Date: Thu, 14 Dec 2017 07:03:50 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: kyungmin.park@...sung.com, dwmw2@...radead.org,
computersforpeace@...il.com, boris.brezillon@...e-electrons.com,
marek.vasut@...il.com, richard@....at, cyrille.pitchen@...ev4u.fr
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH 2/4 v3] 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: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Cross-compiled tested-only
v2: call 'onenand_release()' to undo 'onenand_scan()'
v3: no change
---
drivers/mtd/onenand/samsung.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index b650290611d2..b5497c5a35f1 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -936,6 +936,11 @@ static int s3c_onenand_probe(struct platform_device *pdev)
err = mtd_device_parse_register(mtd, NULL, NULL,
pdata ? pdata->parts : NULL,
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);
--
2.14.1
Powered by blists - more mailing lists