summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-07-25 15:31:44 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2018-07-31 09:46:10 +0200
commitf57bbfb9e3f47b6d4eecb1d8037dab1cda9996a4 (patch)
tree65d0ca20e2b5525f1a3d86d4fe44f75effb5ffe6 /drivers/mtd
parentmtd: rawnand: docg4: convert driver to nand_scan() (diff)
downloadlinux-f57bbfb9e3f47b6d4eecb1d8037dab1cda9996a4.tar.xz
linux-f57bbfb9e3f47b6d4eecb1d8037dab1cda9996a4.zip
mtd: rawnand: jz4740: fix probe function error path
An error after nand_scan_tail() should trigger a nand_cleanup(), not a nand_release() as mtd_device_register() (or one of its variants) has not been called and there is no need to deregister any MTD device yet. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/jz4740_nand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c
index a4052b03249c..3abf87420c10 100644
--- a/drivers/mtd/nand/raw/jz4740_nand.c
+++ b/drivers/mtd/nand/raw/jz4740_nand.c
@@ -472,15 +472,15 @@ static int jz_nand_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "Failed to add mtd device\n");
- goto err_nand_release;
+ goto err_cleanup_nand;
}
dev_info(&pdev->dev, "Successfully registered JZ4740 NAND driver\n");
return 0;
-err_nand_release:
- nand_release(mtd);
+err_cleanup_nand:
+ nand_cleanup(chip);
err_unclaim_banks:
while (chipnr--) {
unsigned char bank = nand->banks[chipnr];