Commit 009e2e1d authored by Miquel Raynal's avatar Miquel Raynal
Browse files

mtd: rawnand: denali: Stop using nand_release()



This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-12-miquel.raynal@bootlin.com
parent 6ac64a17
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1360,9 +1360,14 @@ EXPORT_SYMBOL(denali_init);
void denali_remove(struct denali_controller *denali)
{
	struct denali_chip *dchip, *tmp;
	struct nand_chip *chip;
	int ret;

	list_for_each_entry_safe(dchip, tmp, &denali->chips, node) {
		nand_release(&dchip->chip);
		chip = &dchip->chip;
		ret = mtd_device_unregister(nand_to_mtd(chip));
		WARN_ON(ret);
		nand_cleanup(chip);
		list_del(&dchip->node);
	}