diff mbox series

[2/4] crypto: caam - Simplify with dev_err_probe()

Message ID 20200902150530.14640-2-krzk@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/4] crypto: caam - Fix kerneldoc | expand

Commit Message

Krzysztof Kozlowski Sept. 2, 2020, 3:05 p.m. UTC
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/crypto/caam/caamalg_qi2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Iuliana Prodan Sept. 3, 2020, 12:04 p.m. UTC | #1
On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>

> ---
>   drivers/crypto/caam/caamalg_qi2.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
> index 0441e4ff2df2..076c6b04bea9 100644
> --- a/drivers/crypto/caam/caamalg_qi2.c
> +++ b/drivers/crypto/caam/caamalg_qi2.c
> @@ -5115,8 +5115,7 @@ static int dpaa2_caam_probe(struct fsl_mc_device *dpseci_dev)
>   	/* DPIO */
>   	err = dpaa2_dpseci_dpio_setup(priv);
>   	if (err) {
> -		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "dpaa2_dpseci_dpio_setup() failed\n");
> +		dev_err_probe(dev, err, "dpaa2_dpseci_dpio_setup() failed\n");
>   		goto err_dpio_setup;
>   	}
>   
>
diff mbox series

Patch

diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
index 0441e4ff2df2..076c6b04bea9 100644
--- a/drivers/crypto/caam/caamalg_qi2.c
+++ b/drivers/crypto/caam/caamalg_qi2.c
@@ -5115,8 +5115,7 @@  static int dpaa2_caam_probe(struct fsl_mc_device *dpseci_dev)
 	/* DPIO */
 	err = dpaa2_dpseci_dpio_setup(priv);
 	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(dev, "dpaa2_dpseci_dpio_setup() failed\n");
+		dev_err_probe(dev, err, "dpaa2_dpseci_dpio_setup() failed\n");
 		goto err_dpio_setup;
 	}