diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-04-21 20:00:41 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-04-29 08:56:45 +0200 |
commit | 838c07b05b369b3ee6bb18cdc1aec1241a1ef951 (patch) | |
tree | cba1d2785224fb0ae4086707ad828cedbd66dc36 /drivers/mtd/nand | |
parent | ed64cb1df48152743a927a1187413de35b940441 (diff) | |
download | op-kernel-dev-838c07b05b369b3ee6bb18cdc1aec1241a1ef951.zip op-kernel-dev-838c07b05b369b3ee6bb18cdc1aec1241a1ef951.tar.gz |
mtd: rawnand: lpc32xx_mlc: 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/nand')
-rw-r--r-- | drivers/mtd/nand/raw/lpc32xx_mlc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index 6e31faf..052d123 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c @@ -806,12 +806,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(nand_chip); free_irq: free_irq(host->irq, host); release_dma_chan: |