diff mbox series

[3/3] hwrng: xgene - Improve error reporting for problems during .remove()

Message ID 20230214162829.113148-4-u.kleine-koenig@pengutronix.de
State Accepted
Commit 0e44db95eecb30aade0cac6cb8450e8bceeff4d2
Headers show
Series hwrng: xgene - Some improvements | expand

Commit Message

Uwe Kleine-König Feb. 14, 2023, 4:28 p.m. UTC
Returning an error value in a platform driver's remove callback results in
a generic error message being emitted by the driver core, but otherwise it
doesn't make a difference. The device goes away anyhow.

As the driver already emits a better error message than the core, suppress
the generic error message by returning zero unconditionally.
---
 drivers/char/hw_random/xgene-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Uwe Kleine-König March 14, 2023, 9:04 a.m. UTC | #1
Hello,

On Tue, Feb 14, 2023 at 05:28:29PM +0100, Uwe Kleine-König wrote:
> Returning an error value in a platform driver's remove callback results in
> a generic error message being emitted by the driver core, but otherwise it
> doesn't make a difference. The device goes away anyhow.
> 
> As the driver already emits a better error message than the core, suppress
> the generic error message by returning zero unconditionally.

I forgot to add a S-o-b line here. Stephen Rothwell pointed that out for
the applied patch in next.

I don't know how/if Herbert will fix this, but for the Record:

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/char/hw_random/xgene-rng.c b/drivers/char/hw_random/xgene-rng.c
index 31662614a48f..c67d3185b5b6 100644
--- a/drivers/char/hw_random/xgene-rng.c
+++ b/drivers/char/hw_random/xgene-rng.c
@@ -366,7 +366,7 @@  static int xgene_rng_remove(struct platform_device *pdev)
 	if (rc)
 		dev_err(&pdev->dev, "RNG init wakeup failed error %d\n", rc);
 
-	return rc;
+	return 0;
 }
 
 static const struct of_device_id xgene_rng_of_match[] = {