linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Aymen Sghaier" <aymen.sghaier@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	"Iuliana Prodan" <iuliana.prodan@nxp.com>,
	linux-kernel@vger.kernel.org,
	"Maxime Ripard" <mripard@kernel.org>,
	linux-stm32@st-md-mailman.stormreply.com,
	"Chen-Yu Tsai" <wens@csie.org>,
	linux-crypto@vger.kernel.org,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org,
	"Alexandre Torgue" <alexandre.torgue@st.com>
Subject: Re: [PATCH v2 4/4] crypto: allwinner/sun8i - Simplify with dev_err_probe()
Date: Wed, 16 Sep 2020 11:33:09 +0200	[thread overview]
Message-ID: <20200916093309.GA11483@Red> (raw)
In-Reply-To: <20200910192919.12503-4-krzk@kernel.org>

On Thu, Sep 10, 2020 at 09:29:19PM +0200, 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>
> 
> ---
> 
> Changes since v1:
> 1. None
> ---
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 9 +++------
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 9 +++------
>  2 files changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
> index 138759dc8190..e3c62051c595 100644
> --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
> +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
> @@ -573,12 +573,9 @@ static int sun8i_ce_probe(struct platform_device *pdev)
>  		return irq;
>  
>  	ce->reset = devm_reset_control_get(&pdev->dev, NULL);
> -	if (IS_ERR(ce->reset)) {
> -		if (PTR_ERR(ce->reset) == -EPROBE_DEFER)
> -			return PTR_ERR(ce->reset);
> -		dev_err(&pdev->dev, "No reset control found\n");
> -		return PTR_ERR(ce->reset);
> -	}
> +	if (IS_ERR(ce->reset))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(ce->reset),
> +				     "No reset control found\n");
>  
>  	mutex_init(&ce->mlock);
>  
> diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
> index 9a23515783a6..576df8c8df51 100644
> --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
> +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
> @@ -545,12 +545,9 @@ static int sun8i_ss_probe(struct platform_device *pdev)
>  		return irq;
>  
>  	ss->reset = devm_reset_control_get(&pdev->dev, NULL);
> -	if (IS_ERR(ss->reset)) {
> -		if (PTR_ERR(ss->reset) == -EPROBE_DEFER)
> -			return PTR_ERR(ss->reset);
> -		dev_err(&pdev->dev, "No reset control found\n");
> -		return PTR_ERR(ss->reset);
> -	}
> +	if (IS_ERR(ss->reset))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(ss->reset),
> +				     "No reset control found\n");
>  
>  	mutex_init(&ss->mlock);
>  
> -- 
> 2.17.1
> 

Hello

Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-16  9:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 19:29 [PATCH v2 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
2020-09-10 19:29 ` [PATCH v2 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-10 19:29 ` [PATCH v2 3/4] crypto: stm32-hash " Krzysztof Kozlowski
2020-09-10 19:29 ` [PATCH v2 4/4] crypto: allwinner/sun8i " Krzysztof Kozlowski
2020-09-16  9:33   ` Corentin Labbe [this message]
2020-09-11  9:16 ` [PATCH v2 1/4] crypto: caam - Fix kerneldoc Iuliana Prodan
2020-09-18  7:30 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916093309.GA11483@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=iuliana.prodan@nxp.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mripard@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).