Skip to content

Commit b1f0390

Browse files
Uwe Kleine-Königdlezcano
authored andcommitted
clocksource/drivers/timer-ti-dm: 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 (mostly) ignored 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. 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> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230313075430.2730803-6-u.kleine-koenig@pengutronix.de
1 parent d7b7642 commit b1f0390

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/clocksource/timer-ti-dm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
11771177
* In addition to freeing platform resources it also deletes the timer
11781178
* entry from the local list.
11791179
*/
1180-
static int omap_dm_timer_remove(struct platform_device *pdev)
1180+
static void omap_dm_timer_remove(struct platform_device *pdev)
11811181
{
11821182
struct dmtimer *timer;
11831183
unsigned long flags;
@@ -1199,8 +1199,6 @@ static int omap_dm_timer_remove(struct platform_device *pdev)
11991199

12001200
if (ret)
12011201
dev_err(&pdev->dev, "Unable to determine timer entry in list of drivers on remove\n");
1202-
1203-
return 0;
12041202
}
12051203

12061204
static const struct omap_dm_timer_ops dmtimer_ops = {
@@ -1275,7 +1273,7 @@ MODULE_DEVICE_TABLE(of, omap_timer_match);
12751273

12761274
static struct platform_driver omap_dm_timer_driver = {
12771275
.probe = omap_dm_timer_probe,
1278-
.remove = omap_dm_timer_remove,
1276+
.remove_new = omap_dm_timer_remove,
12791277
.driver = {
12801278
.name = "omap_timer",
12811279
.of_match_table = omap_timer_match,

0 commit comments

Comments
 (0)