Skip to content

Commit fe12bec

Browse files
Uwe Kleine-Königvinodkoul
authored andcommitted
soundwire: qcom: 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent b3a6809 commit fe12bec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/soundwire/qcom.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,14 +1636,12 @@ static int qcom_swrm_probe(struct platform_device *pdev)
16361636
return ret;
16371637
}
16381638

1639-
static int qcom_swrm_remove(struct platform_device *pdev)
1639+
static void qcom_swrm_remove(struct platform_device *pdev)
16401640
{
16411641
struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(&pdev->dev);
16421642

16431643
sdw_bus_master_delete(&ctrl->bus);
16441644
clk_disable_unprepare(ctrl->hclk);
1645-
1646-
return 0;
16471645
}
16481646

16491647
static int __maybe_unused swrm_runtime_resume(struct device *dev)
@@ -1769,7 +1767,7 @@ MODULE_DEVICE_TABLE(of, qcom_swrm_of_match);
17691767

17701768
static struct platform_driver qcom_swrm_driver = {
17711769
.probe = &qcom_swrm_probe,
1772-
.remove = &qcom_swrm_remove,
1770+
.remove_new = qcom_swrm_remove,
17731771
.driver = {
17741772
.name = "qcom-soundwire",
17751773
.of_match_table = qcom_swrm_of_match,

0 commit comments

Comments
 (0)