Skip to content

Commit 1cd966c

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/soc/qcom/smp2p.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
660660
return -EINVAL;
661661
}
662662

663-
static int qcom_smp2p_remove(struct platform_device *pdev)
663+
static void qcom_smp2p_remove(struct platform_device *pdev)
664664
{
665665
struct qcom_smp2p *smp2p = platform_get_drvdata(pdev);
666666
struct smp2p_entry *entry;
@@ -676,8 +676,6 @@ static int qcom_smp2p_remove(struct platform_device *pdev)
676676
mbox_free_channel(smp2p->mbox_chan);
677677

678678
smp2p->out->valid_entries = 0;
679-
680-
return 0;
681679
}
682680

683681
static const struct of_device_id qcom_smp2p_of_match[] = {
@@ -688,7 +686,7 @@ MODULE_DEVICE_TABLE(of, qcom_smp2p_of_match);
688686

689687
static struct platform_driver qcom_smp2p_driver = {
690688
.probe = qcom_smp2p_probe,
691-
.remove = qcom_smp2p_remove,
689+
.remove_new = qcom_smp2p_remove,
692690
.driver = {
693691
.name = "qcom_smp2p",
694692
.of_match_table = qcom_smp2p_of_match,

0 commit comments

Comments
 (0)