Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: inno_rk3036: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-49-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
8756b2ec 516ef43d

+2 -4
+2 -4
sound/soc/codecs/inno_rk3036.c
··· 457 457 return ret; 458 458 } 459 459 460 - static int rk3036_codec_platform_remove(struct platform_device *pdev) 460 + static void rk3036_codec_platform_remove(struct platform_device *pdev) 461 461 { 462 462 struct rk3036_codec_priv *priv = dev_get_drvdata(&pdev->dev); 463 463 464 464 clk_disable_unprepare(priv->pclk); 465 - 466 - return 0; 467 465 } 468 466 469 467 static const struct of_device_id rk3036_codec_of_match[] __maybe_unused = { ··· 476 478 .of_match_table = of_match_ptr(rk3036_codec_of_match), 477 479 }, 478 480 .probe = rk3036_codec_platform_probe, 479 - .remove = rk3036_codec_platform_remove, 481 + .remove_new = rk3036_codec_platform_remove, 480 482 }; 481 483 482 484 module_platform_driver(rk3036_codec_platform_driver);