mtd: rawnand: hisi504: fix the probe function error path
authorMiquel Raynal <miquel.raynal@bootlin.com>
Sat, 21 Apr 2018 18:00:39 +0000 (20:00 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 29 Apr 2018 06:56:44 +0000 (08:56 +0200)
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>
drivers/mtd/nand/raw/hisi504_nand.c

index 3c64a62..a1e009c 100644 (file)
@@ -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;
        }