Skip to content

Commit a47ff90

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: qcom_stats: 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-25-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 57b3172 commit a47ff90

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/qcom/qcom_stats.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,11 @@ static int qcom_stats_probe(struct platform_device *pdev)
216216
return 0;
217217
}
218218

219-
static int qcom_stats_remove(struct platform_device *pdev)
219+
static void qcom_stats_remove(struct platform_device *pdev)
220220
{
221221
struct dentry *root = platform_get_drvdata(pdev);
222222

223223
debugfs_remove_recursive(root);
224-
225-
return 0;
226224
}
227225

228226
static const struct stats_config rpm_data = {
@@ -272,7 +270,7 @@ MODULE_DEVICE_TABLE(of, qcom_stats_table);
272270

273271
static struct platform_driver qcom_stats = {
274272
.probe = qcom_stats_probe,
275-
.remove = qcom_stats_remove,
273+
.remove_new = qcom_stats_remove,
276274
.driver = {
277275
.name = "qcom_stats",
278276
.of_match_table = qcom_stats_table,

0 commit comments

Comments
 (0)