Skip to content

Commit

Permalink
mtd: rawnand: omap2: Suppress error message after WARN in .remove()
Browse files Browse the repository at this point in the history
Returning an error value in a platform remove callback results in an error
message being emitted by the platform core, but otherwise it doesn't make
a difference. After the WARN splat this generic error message doesn't add
any value, so return 0 unconditionally

Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
  • Loading branch information
Uwe Kleine-König authored and miquelraynal committed Jun 9, 2022
1 parent 279d719 commit 37e0024
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/nand/raw/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,16 +2278,14 @@ static int omap_nand_remove(struct platform_device *pdev)
struct mtd_info *mtd = platform_get_drvdata(pdev);
struct nand_chip *nand_chip = mtd_to_nand(mtd);
struct omap_nand_info *info = mtd_to_omap(mtd);
int ret;

rawnand_sw_bch_cleanup(nand_chip);

if (info->dma)
dma_release_channel(info->dma);
ret = mtd_device_unregister(mtd);
WARN_ON(ret);
WARN_ON(mtd_device_unregister(mtd));
nand_cleanup(nand_chip);
return ret;
return 0;
}

/* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */
Expand Down

0 comments on commit 37e0024

Please sign in to comment.