spi: spi-imx: Use dev_err_probe for failed DMA channel requests
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Wed, 10 Jan 2024 08:54:03 +0000 (09:54 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 23 Jan 2024 13:28:04 +0000 (13:28 +0000)
If dma_request_chan() fails, no error is shown nor any information is
shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
Use dev_err_probe to fix both problems.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://msgid.link/r/20240110085403.457089-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-imx.c

index 272bc871a848b833e6e673740f4be5f8f3a16294..546cdce525fc5b1b49b305b872e81d2b0aed0cb5 100644 (file)
@@ -1344,7 +1344,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
        controller->dma_tx = dma_request_chan(dev, "tx");
        if (IS_ERR(controller->dma_tx)) {
                ret = PTR_ERR(controller->dma_tx);
-               dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret);
+               dev_err_probe(dev, ret, "can't get the TX DMA channel!\n");
                controller->dma_tx = NULL;
                goto err;
        }
@@ -1353,7 +1353,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
        controller->dma_rx = dma_request_chan(dev, "rx");
        if (IS_ERR(controller->dma_rx)) {
                ret = PTR_ERR(controller->dma_rx);
-               dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret);
+               dev_err_probe(dev, ret, "can't get the RX DMA channel!\n");
                controller->dma_rx = NULL;
                goto err;
        }