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>
This commit is contained in:
Miquel Raynal 2018-04-21 20:00:39 +02:00 committed by Boris Brezillon
parent 9326dc754c
commit 6f533c4631

View 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;
}