Skip to content

Commit 63c4e0d

Browse files
Uwe Kleine-Königmathieupoirier
authored andcommitted
remoteproc: qcom_q6v5_wcss: 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: Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20230504194453.1150368-13-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 57c05a6 commit 63c4e0d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/remoteproc/qcom_q6v5_wcss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,16 +1074,14 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
10741074
return ret;
10751075
}
10761076

1077-
static int q6v5_wcss_remove(struct platform_device *pdev)
1077+
static void q6v5_wcss_remove(struct platform_device *pdev)
10781078
{
10791079
struct rproc *rproc = platform_get_drvdata(pdev);
10801080
struct q6v5_wcss *wcss = rproc->priv;
10811081

10821082
qcom_q6v5_deinit(&wcss->q6v5);
10831083
rproc_del(rproc);
10841084
rproc_free(rproc);
1085-
1086-
return 0;
10871085
}
10881086

10891087
static const struct wcss_data wcss_ipq8074_res_init = {
@@ -1117,7 +1115,7 @@ MODULE_DEVICE_TABLE(of, q6v5_wcss_of_match);
11171115

11181116
static struct platform_driver q6v5_wcss_driver = {
11191117
.probe = q6v5_wcss_probe,
1120-
.remove = q6v5_wcss_remove,
1118+
.remove_new = q6v5_wcss_remove,
11211119
.driver = {
11221120
.name = "qcom-q6v5-wcss-pil",
11231121
.of_match_table = q6v5_wcss_of_match,

0 commit comments

Comments
 (0)