[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48f16656-af30-cd6f-5adf-8b7dac0818a0@microchip.com>
Date: Wed, 26 Jul 2023 15:54:39 +0000
From: <Ryan.Wanner@...rochip.com>
To: <machel@...o.com>, <herbert@...dor.apana.org.au>,
<davem@...emloft.net>, <Nicolas.Ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <Claudiu.Beznea@...rochip.com>,
<linux-crypto@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <opensource.kernel@...o.com>
Subject: Re: [PATCH v2] crypto: atmel: Use dev_err_probe instead of dev_err
On 7/26/23 05:04, Wang Ming wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> It is possible that dma_request_chan will return EPROBE_DEFER,
> which means that dd->dev is not ready yet. In this case,
> dev_err(dd->dev), there will be no output. This patch fixes the bug.
>
> Signed-off-by: Wang Ming <machel@...o.com>
Reviewed-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
> ---
> drivers/crypto/atmel-sha.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
> index 6bef634d3c86..5682957f805d 100644
> --- a/drivers/crypto/atmel-sha.c
> +++ b/drivers/crypto/atmel-sha.c
> @@ -2499,8 +2499,8 @@ static int atmel_sha_dma_init(struct atmel_sha_dev *dd)
> {
> dd->dma_lch_in.chan = dma_request_chan(dd->dev, "tx");
> if (IS_ERR(dd->dma_lch_in.chan)) {
> - dev_err(dd->dev, "DMA channel is not available\n");
> - return PTR_ERR(dd->dma_lch_in.chan);
> + return dev_err_probe(dd->dev, PTR_ERR(dd->dma_lch_in.chan),
> + "DMA channel is not available\n");
> }
>
> dd->dma_lch_in.dma_conf.dst_addr = dd->phys_base +
> --
> 2.25.1
>
Powered by blists - more mailing lists