Skip to content

Commit c0989f7

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: socinfo: 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 <[email protected]> Acked-by: Konrad Dybcio <[email protected]> # qcom Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent bdd7cc6 commit c0989f7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/soc/qcom/socinfo.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,20 +787,18 @@ static int qcom_socinfo_probe(struct platform_device *pdev)
787787
return 0;
788788
}
789789

790-
static int qcom_socinfo_remove(struct platform_device *pdev)
790+
static void qcom_socinfo_remove(struct platform_device *pdev)
791791
{
792792
struct qcom_socinfo *qs = platform_get_drvdata(pdev);
793793

794794
soc_device_unregister(qs->soc_dev);
795795

796796
socinfo_debugfs_exit(qs);
797-
798-
return 0;
799797
}
800798

801799
static struct platform_driver qcom_socinfo_driver = {
802800
.probe = qcom_socinfo_probe,
803-
.remove = qcom_socinfo_remove,
801+
.remove_new = qcom_socinfo_remove,
804802
.driver = {
805803
.name = "qcom-socinfo",
806804
},

0 commit comments

Comments
 (0)