Skip to content

Commit 8210f49

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
ASoC: meson: Make meson_card_remove() return 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. meson_card_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20231013221945.1489203-14-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 393df6f commit 8210f49

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

sound/soc/meson/axg-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ MODULE_DEVICE_TABLE(of, axg_card_of_match);
360360

361361
static struct platform_driver axg_card_pdrv = {
362362
.probe = meson_card_probe,
363-
.remove = meson_card_remove,
363+
.remove_new = meson_card_remove,
364364
.driver = {
365365
.name = "axg-sound-card",
366366
.of_match_table = axg_card_of_match,

sound/soc/meson/gx-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ MODULE_DEVICE_TABLE(of, gx_card_of_match);
130130

131131
static struct platform_driver gx_card_pdrv = {
132132
.probe = meson_card_probe,
133-
.remove = meson_card_remove,
133+
.remove_new = meson_card_remove,
134134
.driver = {
135135
.name = "gx-sound-card",
136136
.of_match_table = gx_card_of_match,

sound/soc/meson/meson-card-utils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,11 @@ int meson_card_probe(struct platform_device *pdev)
327327
}
328328
EXPORT_SYMBOL_GPL(meson_card_probe);
329329

330-
int meson_card_remove(struct platform_device *pdev)
330+
void meson_card_remove(struct platform_device *pdev)
331331
{
332332
struct meson_card *priv = platform_get_drvdata(pdev);
333333

334334
meson_card_clean_references(priv);
335-
336-
return 0;
337335
}
338336
EXPORT_SYMBOL_GPL(meson_card_remove);
339337

sound/soc/meson/meson-card.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ int meson_card_set_fe_link(struct snd_soc_card *card,
4949
bool is_playback);
5050

5151
int meson_card_probe(struct platform_device *pdev);
52-
int meson_card_remove(struct platform_device *pdev);
52+
void meson_card_remove(struct platform_device *pdev);
5353

5454
#endif /* _MESON_SND_CARD_H */

0 commit comments

Comments
 (0)