Skip to content

Commit 57b3172

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: qcom_gsbi: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-24-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent ffbe84a commit 57b3172

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/qcom/qcom_gsbi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,11 @@ static int gsbi_probe(struct platform_device *pdev)
212212
return of_platform_populate(node, NULL, NULL, &pdev->dev);
213213
}
214214

215-
static int gsbi_remove(struct platform_device *pdev)
215+
static void gsbi_remove(struct platform_device *pdev)
216216
{
217217
struct gsbi_info *gsbi = platform_get_drvdata(pdev);
218218

219219
clk_disable_unprepare(gsbi->hclk);
220-
221-
return 0;
222220
}
223221

224222
static const struct of_device_id gsbi_dt_match[] = {
@@ -234,7 +232,7 @@ static struct platform_driver gsbi_driver = {
234232
.of_match_table = gsbi_dt_match,
235233
},
236234
.probe = gsbi_probe,
237-
.remove = gsbi_remove,
235+
.remove_new = gsbi_remove,
238236
};
239237

240238
module_platform_driver(gsbi_driver);

0 commit comments

Comments
 (0)