Skip to content

Commit

Permalink
mtd: rawnand: xway: Stop using nand_release()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
  • Loading branch information
miquelraynal committed May 31, 2020
1 parent 34531be commit 9fdd78f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/mtd/nand/raw/xway_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ static int xway_nand_probe(struct platform_device *pdev)
static int xway_nand_remove(struct platform_device *pdev)
{
struct xway_nand_data *data = platform_get_drvdata(pdev);
struct nand_chip *chip = &data->chip;
int ret;

nand_release(&data->chip);
ret = mtd_device_unregister(mtd);
WARN_ON(ret);
nand_cleanup(chip);

return 0;
}
Expand Down

0 comments on commit 9fdd78f

Please sign in to comment.