Skip to content

Commit ad12305

Browse files
Uwe Kleine-Königmathieupoirier
authored andcommitted
remoteproc: meson_mx_ao_arc: 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> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20230504194453.1150368-6-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 10f19fd commit ad12305

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/remoteproc/meson_mx_ao_arc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,13 @@ static int meson_mx_ao_arc_rproc_probe(struct platform_device *pdev)
228228
return ret;
229229
}
230230

231-
static int meson_mx_ao_arc_rproc_remove(struct platform_device *pdev)
231+
static void meson_mx_ao_arc_rproc_remove(struct platform_device *pdev)
232232
{
233233
struct rproc *rproc = platform_get_drvdata(pdev);
234234
struct meson_mx_ao_arc_rproc_priv *priv = rproc->priv;
235235

236236
rproc_del(rproc);
237237
gen_pool_free(priv->sram_pool, priv->sram_va, priv->sram_size);
238-
239-
return 0;
240238
}
241239

242240
static const struct of_device_id meson_mx_ao_arc_rproc_match[] = {
@@ -248,7 +246,7 @@ MODULE_DEVICE_TABLE(of, meson_mx_ao_arc_rproc_match);
248246

249247
static struct platform_driver meson_mx_ao_arc_rproc_driver = {
250248
.probe = meson_mx_ao_arc_rproc_probe,
251-
.remove = meson_mx_ao_arc_rproc_remove,
249+
.remove_new = meson_mx_ao_arc_rproc_remove,
252250
.driver = {
253251
.name = "meson-mx-ao-arc-rproc",
254252
.of_match_table = meson_mx_ao_arc_rproc_match,

0 commit comments

Comments
 (0)