Skip to content

Commit bdd7cc6

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: smsm: 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 1cd966c commit bdd7cc6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/soc/qcom/smsm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static int qcom_smsm_probe(struct platform_device *pdev)
613613
return ret;
614614
}
615615

616-
static int qcom_smsm_remove(struct platform_device *pdev)
616+
static void qcom_smsm_remove(struct platform_device *pdev)
617617
{
618618
struct qcom_smsm *smsm = platform_get_drvdata(pdev);
619619
unsigned id;
@@ -623,8 +623,6 @@ static int qcom_smsm_remove(struct platform_device *pdev)
623623
irq_domain_remove(smsm->entries[id].domain);
624624

625625
qcom_smem_state_unregister(smsm->state);
626-
627-
return 0;
628626
}
629627

630628
static const struct of_device_id qcom_smsm_of_match[] = {
@@ -635,7 +633,7 @@ MODULE_DEVICE_TABLE(of, qcom_smsm_of_match);
635633

636634
static struct platform_driver qcom_smsm_driver = {
637635
.probe = qcom_smsm_probe,
638-
.remove = qcom_smsm_remove,
636+
.remove_new = qcom_smsm_remove,
639637
.driver = {
640638
.name = "qcom-smsm",
641639
.of_match_table = qcom_smsm_of_match,

0 commit comments

Comments
 (0)