mtd: rawnand: sharpsl: 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-50-miquel.raynal@bootlin.com
This commit is contained in:
@@ -199,13 +199,19 @@ err_get_res:
|
|||||||
static int sharpsl_nand_remove(struct platform_device *pdev)
|
static int sharpsl_nand_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev);
|
struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev);
|
||||||
|
struct nand_chip *chip = &sharpsl->chip;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Release resources, unregister device */
|
/* Unregister device */
|
||||||
nand_release(&sharpsl->chip);
|
ret = mtd_device_unregister(nand_to_mtd(chip));
|
||||||
|
WARN_ON(ret);
|
||||||
|
|
||||||
|
/* Release resources */
|
||||||
|
nand_cleanup(chip);
|
||||||
|
|
||||||
iounmap(sharpsl->io);
|
iounmap(sharpsl->io);
|
||||||
|
|
||||||
/* Free the MTD device structure */
|
/* Free the driver's structure */
|
||||||
kfree(sharpsl);
|
kfree(sharpsl);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user