clocksource/drivers/timer-ti-dm: Improve error message in .remove
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 13 Mar 2023 07:54:28 +0000 (08:54 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 24 Apr 2023 14:56:13 +0000 (16:56 +0200)
If a platform driver's remove callback returns an error code, the driver
core emits a generic (and thus little helpful) error message.

Instead emit a more specifc error message about the actual error and
return zero to suppress the core's message.

Note that returning zero has no side effects apart from not emitting
said error message. This prepares converting platform driver's remove
message to return void.

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-4-u.kleine-koenig@pengutronix.de
drivers/clocksource/timer-ti-dm.c

index b24b903a882229767ebb9c5a6ecc8b3ce1d89281..098562bda4876c745f266dbf7c39ec3dc87f9809 100644 (file)
@@ -1197,7 +1197,10 @@ static int omap_dm_timer_remove(struct platform_device *pdev)
 
        pm_runtime_disable(&pdev->dev);
 
-       return ret;
+       if (ret)
+               dev_err(&pdev->dev, "Unable to determine timer entry in list of drivers on remove\n");
+
+       return 0;
 }
 
 static const struct omap_dm_timer_ops dmtimer_ops = {