1
0
Fork 0

mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered

commit 7a0c18fb5c upstream.

Do not call nand_release() while the MTD device has not been
registered, use nand_cleanup() instead.

Fixes: 02f26ecf8c ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-4-miquel.raynal@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Miquel Raynal 2020-04-24 18:44:58 +02:00 committed by Greg Kroah-Hartman
parent 5f59ce425f
commit be953ad71c
1 changed files with 1 additions and 1 deletions

View File

@ -2664,7 +2664,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
ret = mtd_device_register(mtd, NULL, 0);
if (ret) {
dev_err(dev, "failed to register mtd device: %d\n", ret);
nand_release(chip);
nand_cleanup(chip);
return ret;
}