summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-04-21 20:00:43 +0200
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-04-29 08:56:46 +0200
commit553b0c6416e4426d0c8e552ff809c0a590dc3989 (patch)
tree0bfb15b3beac28db5b46461f3a5b89db8aaeeaa4 /drivers/mtd
parentmtd: rawnand: lpc32xx_slc: clean the probe function (diff)
downloadlinux-553b0c6416e4426d0c8e552ff809c0a590dc3989.tar.xz
linux-553b0c6416e4426d0c8e552ff809c0a590dc3989.zip
mtd: rawnand: lpc32xx_slc: fix the probe function error path
An error after nand_scan_tail() should trigger a nand_cleanup() and not a nand_release(). The latter doing an mtd_device_unregister() which is not needed if mtd_device_register() failed. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/lpc32xx_slc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/lpc32xx_slc.c b/drivers/mtd/nand/raw/lpc32xx_slc.c
index 064c9389ee0c..42820aa1abab 100644
--- a/drivers/mtd/nand/raw/lpc32xx_slc.c
+++ b/drivers/mtd/nand/raw/lpc32xx_slc.c
@@ -926,12 +926,12 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
res = mtd_device_register(mtd, host->ncfg->parts,
host->ncfg->num_parts);
if (res)
- goto release_nand;
+ goto cleanup_nand;
return 0;
-release_nand:
- nand_release(mtd);
+cleanup_nand:
+ nand_cleanup(chip);
release_dma:
dma_release_channel(host->dma_chan);
unprepare_clk: