Commit 15c71a4c authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Mark Brown

ASoC: pxa: mmp-sspa: 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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-117-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 75c1ed91
......@@ -545,7 +545,7 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
return 0;
}
static int asoc_mmp_sspa_remove(struct platform_device *pdev)
static void asoc_mmp_sspa_remove(struct platform_device *pdev)
{
struct sspa_priv *sspa = platform_get_drvdata(pdev);
......@@ -553,11 +553,10 @@ static int asoc_mmp_sspa_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
if (pdev->dev.of_node)
return 0;
return;
clk_put(sspa->audio_clk);
clk_put(sspa->sysclk);
return 0;
}
#ifdef CONFIG_OF
......@@ -575,7 +574,7 @@ static struct platform_driver asoc_mmp_sspa_driver = {
.of_match_table = of_match_ptr(mmp_sspa_of_match),
},
.probe = asoc_mmp_sspa_probe,
.remove = asoc_mmp_sspa_remove,
.remove_new = asoc_mmp_sspa_remove,
};
module_platform_driver(asoc_mmp_sspa_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment