[PATCH 11/14] mtd: rawnand: meson: Don't skip cleanup after mtd_device_unregister() failed

Miquel Raynal miquel.raynal at bootlin.com
Thu Jun 9 06:09:29 PDT 2022


On Fri, 2022-06-03 at 21:07:55 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> If mtd_device_unregister() fails (which it doesn't when used correctly),
> the resources bound by the nand chip should be freed anyhow as returning
> an error value doesn't prevent the device getting unbound.
> 
> Instead use WARN_ON on the return value similar to how other drivers do
> it. Then meson_nfc_nand_chip_cleanup() returns 0 unconditionally and can
> be changed to return void which allows further simplification in the
> remove callback.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-amlogic mailing list