diff options
author | Wang Ming <machel@vivo.com> | 2023-07-26 18:54:47 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-31 12:44:57 +0100 |
commit | 893aa09ee5959533d8e51e06b1bde35286edaf70 (patch) | |
tree | dd7a5a1b6c47d3998e4adb69219f7e76745fbb10 | |
parent | 4ee0feccf2b372134d899a01ee025739f4ddfdca (diff) | |
download | lwn-893aa09ee5959533d8e51e06b1bde35286edaf70.tar.gz lwn-893aa09ee5959533d8e51e06b1bde35286edaf70.zip |
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>
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 83fd062fc491..c16abc2a9e9b 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -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; } |