Skip to content

Commit 491a113

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
ASoC: cs42l43: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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-11-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 46dd58b commit 491a113

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sound/soc/codecs/cs42l43.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,13 +2232,11 @@ static int cs42l43_codec_probe(struct platform_device *pdev)
22322232
return ret;
22332233
}
22342234

2235-
static int cs42l43_codec_remove(struct platform_device *pdev)
2235+
static void cs42l43_codec_remove(struct platform_device *pdev)
22362236
{
22372237
struct cs42l43_codec *priv = platform_get_drvdata(pdev);
22382238

22392239
clk_put(priv->mclk);
2240-
2241-
return 0;
22422240
}
22432241

22442242
static int cs42l43_codec_runtime_resume(struct device *dev)
@@ -2269,7 +2267,7 @@ static struct platform_driver cs42l43_codec_driver = {
22692267
},
22702268

22712269
.probe = cs42l43_codec_probe,
2272-
.remove = cs42l43_codec_remove,
2270+
.remove_new = cs42l43_codec_remove,
22732271
.id_table = cs42l43_codec_id_table,
22742272
};
22752273
module_platform_driver(cs42l43_codec_driver);

0 commit comments

Comments
 (0)