mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
spi: Use dev_err_probe instead of dev_err
It is possible that dma_request_chan will return EPROBE_DEFER, which means that dev is not ready yet. In this case, dev_err(dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming <machel@vivo.com> Link: https://lore.kernel.org/r/20230726105457.3743-1-machel@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4ee0feccf2
commit
893aa09ee5
1 changed files with 4 additions and 4 deletions
|
@ -903,15 +903,15 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
|
|||
/* get tx/rx dma */
|
||||
ctlr->dma_tx = dma_request_chan(dev, "tx");
|
||||
if (IS_ERR(ctlr->dma_tx)) {
|
||||
dev_err(dev, "no tx-dma configuration found - not using dma mode\n");
|
||||
ret = PTR_ERR(ctlr->dma_tx);
|
||||
ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_tx),
|
||||
"no tx-dma configuration found - not using dma mode\n");
|
||||
ctlr->dma_tx = NULL;
|
||||
goto err;
|
||||
}
|
||||
ctlr->dma_rx = dma_request_chan(dev, "rx");
|
||||
if (IS_ERR(ctlr->dma_rx)) {
|
||||
dev_err(dev, "no rx-dma configuration found - not using dma mode\n");
|
||||
ret = PTR_ERR(ctlr->dma_rx);
|
||||
ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_rx),
|
||||
"no rx-dma configuration found - not using dma mode\n");
|
||||
ctlr->dma_rx = NULL;
|
||||
goto err_release;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue