hwrng: hisi - use dev_err_probe

Message ID 20240226185700.39411-1-martin@kaiser.cx
State New
Headers
Series hwrng: hisi - use dev_err_probe |

Commit Message

Martin Kaiser Feb. 26, 2024, 6:57 p.m. UTC
  Replace dev_err + return with dev_err_probe.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/hisi-rng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Jonathan Cameron Feb. 27, 2024, 12:20 p.m. UTC | #1
On Mon, 26 Feb 2024 19:57:00 +0100
Martin Kaiser <martin@kaiser.cx> wrote:

> Replace dev_err + return with dev_err_probe.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Maybe worth wrapping the line in this subsystem still strives for
<= 80 chars


> ---
>  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;
>  }
  

Patch

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;
 }