Skip to content

Commit ba03aab

Browse files
Uwe Kleine-Könignmenon
authored andcommitted
soc/ti: smartreflex: 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-39-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent d183b20 commit ba03aab

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/soc/ti/smartreflex.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ static int omap_sr_probe(struct platform_device *pdev)
933933
return ret;
934934
}
935935

936-
static int omap_sr_remove(struct platform_device *pdev)
936+
static void omap_sr_remove(struct platform_device *pdev)
937937
{
938938
struct device *dev = &pdev->dev;
939939
struct omap_sr *sr_info = platform_get_drvdata(pdev);
@@ -945,7 +945,6 @@ static int omap_sr_remove(struct platform_device *pdev)
945945
pm_runtime_disable(dev);
946946
clk_unprepare(sr_info->fck);
947947
list_del(&sr_info->node);
948-
return 0;
949948
}
950949

951950
static void omap_sr_shutdown(struct platform_device *pdev)
@@ -970,7 +969,7 @@ MODULE_DEVICE_TABLE(of, omap_sr_match);
970969

971970
static struct platform_driver smartreflex_driver = {
972971
.probe = omap_sr_probe,
973-
.remove = omap_sr_remove,
972+
.remove_new = omap_sr_remove,
974973
.shutdown = omap_sr_shutdown,
975974
.driver = {
976975
.name = DRIVER_NAME,

0 commit comments

Comments
 (0)