summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-19 15:00:28 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:36 +0200
commitab135c51bb815c57e7f297b9f78f487c70d34899 (patch)
tree75f378a985b9f774aadfa5947a162de7d1d4ac08 /drivers
parentmtd: rawnand: sunxi: Stop using nand_release() (diff)
downloadlinux-ab135c51bb815c57e7f297b9f78f487c70d34899.tar.xz
linux-ab135c51bb815c57e7f297b9f78f487c70d34899.zip
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/raw/tango_nand.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/tango_nand.c b/drivers/mtd/nand/raw/tango_nand.c
index b92de603e6db..246871e01027 100644
--- a/drivers/mtd/nand/raw/tango_nand.c
+++ b/drivers/mtd/nand/raw/tango_nand.c
@@ -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;