Skip to content

Commit 4b8dee9

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: smem: 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 7c93da5 commit 4b8dee9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/soc/qcom/smem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,14 +1187,12 @@ static int qcom_smem_probe(struct platform_device *pdev)
11871187
return 0;
11881188
}
11891189

1190-
static int qcom_smem_remove(struct platform_device *pdev)
1190+
static void qcom_smem_remove(struct platform_device *pdev)
11911191
{
11921192
platform_device_unregister(__smem->socinfo);
11931193

11941194
hwspin_lock_free(__smem->hwlock);
11951195
__smem = NULL;
1196-
1197-
return 0;
11981196
}
11991197

12001198
static const struct of_device_id qcom_smem_of_match[] = {
@@ -1205,7 +1203,7 @@ MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
12051203

12061204
static struct platform_driver qcom_smem_driver = {
12071205
.probe = qcom_smem_probe,
1208-
.remove = qcom_smem_remove,
1206+
.remove_new = qcom_smem_remove,
12091207
.driver = {
12101208
.name = "qcom-smem",
12111209
.of_match_table = qcom_smem_of_match,

0 commit comments

Comments
 (0)