Skip to content

Commit dd714c5

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: icc-bwmon: 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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230925095532.1984344-19-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 3337a6f commit dd714c5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/qcom/icc-bwmon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,11 @@ static int bwmon_probe(struct platform_device *pdev)
793793
return 0;
794794
}
795795

796-
static int bwmon_remove(struct platform_device *pdev)
796+
static void bwmon_remove(struct platform_device *pdev)
797797
{
798798
struct icc_bwmon *bwmon = platform_get_drvdata(pdev);
799799

800800
bwmon_disable(bwmon);
801-
802-
return 0;
803801
}
804802

805803
static const struct icc_bwmon_data msm8998_bwmon_data = {
@@ -862,7 +860,7 @@ MODULE_DEVICE_TABLE(of, bwmon_of_match);
862860

863861
static struct platform_driver bwmon_driver = {
864862
.probe = bwmon_probe,
865-
.remove = bwmon_remove,
863+
.remove_new = bwmon_remove,
866864
.driver = {
867865
.name = "qcom-bwmon",
868866
.of_match_table = bwmon_of_match,

0 commit comments

Comments
 (0)