Skip to content

Commit 46dd58b

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
ASoC: rockchip: i2s_tdm: 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> Link: https://lore.kernel.org/r/20231013221945.1489203-10-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 45f1b12 commit 46dd58b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sound/soc/rockchip/rockchip_i2s_tdm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,14 +1714,12 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
17141714
return ret;
17151715
}
17161716

1717-
static int rockchip_i2s_tdm_remove(struct platform_device *pdev)
1717+
static void rockchip_i2s_tdm_remove(struct platform_device *pdev)
17181718
{
17191719
if (!pm_runtime_status_suspended(&pdev->dev))
17201720
i2s_tdm_runtime_suspend(&pdev->dev);
17211721

17221722
pm_runtime_disable(&pdev->dev);
1723-
1724-
return 0;
17251723
}
17261724

17271725
static int __maybe_unused rockchip_i2s_tdm_suspend(struct device *dev)
@@ -1756,7 +1754,7 @@ static const struct dev_pm_ops rockchip_i2s_tdm_pm_ops = {
17561754

17571755
static struct platform_driver rockchip_i2s_tdm_driver = {
17581756
.probe = rockchip_i2s_tdm_probe,
1759-
.remove = rockchip_i2s_tdm_remove,
1757+
.remove_new = rockchip_i2s_tdm_remove,
17601758
.driver = {
17611759
.name = DRV_NAME,
17621760
.of_match_table = of_match_ptr(rockchip_i2s_tdm_match),

0 commit comments

Comments
 (0)