aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-04-21 20:00:39 +0200
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-04-29 08:56:44 +0200
commit6f533c463105472b71587b9bf8532f34f9d60deb (patch)
tree1be0d443ee7197a438956b8897769f09bbbe3a52 /drivers/mtd/nand
parentmtd: rawnand: hisi504: clean the probe function error path (diff)
downloadlinux-dev-6f533c463105472b71587b9bf8532f34f9d60deb.tar.xz
linux-dev-6f533c463105472b71587b9bf8532f34f9d60deb.zip
mtd: rawnand: hisi504: 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/hisi504_nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/hisi504_nand.c b/drivers/mtd/nand/raw/hisi504_nand.c
index 3c64a6281b54..a1e009c8e556 100644
--- a/drivers/mtd/nand/raw/hisi504_nand.c
+++ b/drivers/mtd/nand/raw/hisi504_nand.c
@@ -808,7 +808,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)
ret = mtd_device_register(mtd, NULL, 0);
if (ret) {
dev_err(dev, "Err MTD partition=%d\n", ret);
- nand_release(mtd);
+ nand_cleanup(chip);
return ret;
}