Skip to content

Commit 49446e5

Browse files
Uwe Kleine-Königandersson
authored andcommitted
rpmsg: qcom_glink_rpm: 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> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230321154039.355098-3-u.kleine-koenig@pengutronix.de
1 parent 810c03d commit 49446e5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rpmsg/qcom_glink_rpm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int glink_rpm_probe(struct platform_device *pdev)
361361
return 0;
362362
}
363363

364-
static int glink_rpm_remove(struct platform_device *pdev)
364+
static void glink_rpm_remove(struct platform_device *pdev)
365365
{
366366
struct glink_rpm *rpm = platform_get_drvdata(pdev);
367367
struct qcom_glink *glink = rpm->glink;
@@ -371,8 +371,6 @@ static int glink_rpm_remove(struct platform_device *pdev)
371371
qcom_glink_native_remove(glink);
372372

373373
mbox_free_channel(rpm->mbox_chan);
374-
375-
return 0;
376374
}
377375

378376
static const struct of_device_id glink_rpm_of_match[] = {
@@ -383,7 +381,7 @@ MODULE_DEVICE_TABLE(of, glink_rpm_of_match);
383381

384382
static struct platform_driver glink_rpm_driver = {
385383
.probe = glink_rpm_probe,
386-
.remove = glink_rpm_remove,
384+
.remove_new = glink_rpm_remove,
387385
.driver = {
388386
.name = "qcom_glink_rpm",
389387
.of_match_table = glink_rpm_of_match,

0 commit comments

Comments
 (0)