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

ASoC: codecs: lpass-va-macro: 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-52-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
b84affc1 10b4f1ed

+2 -4
+2 -4
sound/soc/codecs/lpass-va-macro.c
··· 1575 1575 return ret; 1576 1576 } 1577 1577 1578 - static int va_macro_remove(struct platform_device *pdev) 1578 + static void va_macro_remove(struct platform_device *pdev) 1579 1579 { 1580 1580 struct va_macro *va = dev_get_drvdata(&pdev->dev); 1581 1581 ··· 1584 1584 clk_disable_unprepare(va->macro); 1585 1585 1586 1586 lpass_macro_pds_exit(va->pds); 1587 - 1588 - return 0; 1589 1587 } 1590 1588 1591 1589 static int __maybe_unused va_macro_runtime_suspend(struct device *dev) ··· 1637 1639 .pm = &va_macro_pm_ops, 1638 1640 }, 1639 1641 .probe = va_macro_probe, 1640 - .remove = va_macro_remove, 1642 + .remove_new = va_macro_remove, 1641 1643 }; 1642 1644 1643 1645 module_platform_driver(va_macro_driver);