crypto: Use dev_err_probe instead of dev_err
PATCH v2 1/1 crypto: Use dev_err_probe instead of dev_err
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 <[email protected]>
--- drivers/crypto/omap-aes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/omap-aes.c +4 -4
@@ -236,14 +236,14 @@ static int omap_aes_dma_init(struct omap_aes_dev *dd) dd->dma_lch_in =dma_request_chan (dd->dev,"rx" );if (IS_ERR (dd->dma_lch_in)) { -dev_err (dd->dev,"Unable to request in DMA channel\n" ); -return PTR_ERR (dd->dma_lch_in); +return dev_err_probe (dd->dev,PTR_ERR (dd->dma_lch_in), + Unable to request in DMA channel\n"); } dd->dma_lch_out = dma_request_chan(dd->dev, "tx");if (IS_ERR (dd->dma_lch_out)) { -dev_err (dd->dev,"Unable to request out DMA channel\n" ); - err =PTR_ERR (dd->dma_lch_out); + err =dev_err_probe (dd->dev,PTR_ERR (dd->dma_lch_out), +"Unable to request out DMA channel\n" ); goto err_dma_out; }
Signature · 1 line
2.25.1
Herbert Xu
maintainerQuoted 21 lines · Wang Ming
It is possible that
dma_request_chanwill returnEPROBE_DEFER, which means thatdd->devis 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 <[email protected]>--- drivers/crypto/omap-aes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/crypto/omap-aes.c +2
-2@@ -236,14 +236,14 @@ static int omap_aes_dma_init(struct omap_aes_dev *dd) dd->dma_lch_in =dma_request_chan (dd->dev,"rx" ); if (IS_ERR(dd->dma_lch_in)) { -dev_err (dd->dev,"Unable to request in DMA channel\n" ); -return PTR_ERR (dd->dma_lch_in); + return dev_err_probe(dd->dev, PTR_ERR(dd->dma_lch_in), + Unable to request in DMA channel\n");
drivers/crypto/omap-aes.c static int omap_aes_dma_init(struct omap_aes_dev *dd) · line 248
Quoted 10 lines
drivers/crypto/omap-aes.c +2
-2} dd->dma_lch_out =dma_request_chan (dd->dev,"tx" );if (IS_ERR (dd->dma_lch_out)) { -dev_err (dd->dev,"Unable to request out DMA channel\n" ); - err =PTR_ERR (dd->dma_lch_out); + err =dev_err_probe (dd->dev,PTR_ERR (dd->dma_lch_out), +"Unable to request out DMA channel\n" ); goto err_dma_out; }
This doesn't even compile.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt