mtd: rawnand: tango: 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: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-56-miquel.raynal@bootlin.com
This commit is contained in:
Родитель
068d86ecd9
Коммит
ab135c51bb
|
@ -600,14 +600,19 @@ static int chip_init(struct device *dev, struct device_node *np)
|
|||
|
||||
static int tango_nand_remove(struct platform_device *pdev)
|
||||
{
|
||||
int cs;
|
||||
struct tango_nfc *nfc = platform_get_drvdata(pdev);
|
||||
struct nand_chip *chip;
|
||||
int cs, ret;
|
||||
|
||||
dma_release_channel(nfc->chan);
|
||||
|
||||
for (cs = 0; cs < MAX_CS; ++cs) {
|
||||
if (nfc->chips[cs])
|
||||
nand_release(&nfc->chips[cs]->nand_chip);
|
||||
if (nfc->chips[cs]) {
|
||||
chip = &nfc->chips[cs]->nand_chip;
|
||||
ret = mtd_device_unregister(nand_to_mtd(chip));
|
||||
WARN_ON(ret);
|
||||
nand_cleanup(chip);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче