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

ASoC: sunxi: sun8i-codec: 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: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-145-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
a594f423 116d6c70

+2 -4
+2 -4
sound/soc/sunxi/sun8i-codec.c
··· 1349 1349 return ret; 1350 1350 } 1351 1351 1352 - static int sun8i_codec_remove(struct platform_device *pdev) 1352 + static void sun8i_codec_remove(struct platform_device *pdev) 1353 1353 { 1354 1354 pm_runtime_disable(&pdev->dev); 1355 1355 if (!pm_runtime_status_suspended(&pdev->dev)) 1356 1356 sun8i_codec_runtime_suspend(&pdev->dev); 1357 - 1358 - return 0; 1359 1357 } 1360 1358 1361 1359 static const struct sun8i_codec_quirks sun8i_a33_quirks = { ··· 1383 1385 .pm = &sun8i_codec_pm_ops, 1384 1386 }, 1385 1387 .probe = sun8i_codec_probe, 1386 - .remove = sun8i_codec_remove, 1388 + .remove_new = sun8i_codec_remove, 1387 1389 }; 1388 1390 module_platform_driver(sun8i_codec_driver); 1389 1391