2024-02-26 18:57:31

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH] hwrng: hisi - use dev_err_probe

Replace dev_err + return with dev_err_probe.

Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/char/hw_random/hisi-rng.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hw_random/hisi-rng.c b/drivers/char/hw_random/hisi-rng.c
index b6f27566e0ba..4e501d5c121f 100644
--- a/drivers/char/hw_random/hisi-rng.c
+++ b/drivers/char/hw_random/hisi-rng.c
@@ -89,10 +89,8 @@ static int hisi_rng_probe(struct platform_device *pdev)
rng->rng.read = hisi_rng_read;

ret = devm_hwrng_register(&pdev->dev, &rng->rng);
- if (ret) {
- dev_err(&pdev->dev, "failed to register hwrng\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "failed to register hwrng\n");

return 0;
}
--
2.39.2



2024-03-08 11:24:52

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] hwrng: hisi - use dev_err_probe

On Mon, Feb 26, 2024 at 07:57:00PM +0100, Martin Kaiser wrote:
> Replace dev_err + return with dev_err_probe.
>
> Signed-off-by: Martin Kaiser <[email protected]>
> ---
> drivers/char/hw_random/hisi-rng.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt