]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
spi: fsl-dspi: Preserve error code returned by dmaengine_slave_config()
authorandy.shevchenko@gmail.com <andy.shevchenko@gmail.com>
Sun, 4 Feb 2024 20:29:18 +0000 (22:29 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 5 Feb 2024 14:35:38 +0000 (14:35 +0000)
dmaengine_slave_config() may return different error codes based on
the circumstances. Preserve it instead of shadowing to -EINVAL.

Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20240204203127.1186621-2-andy.shevchenko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c

index c9eae046f66c9e746822e0275beb6b3715e89ff2..0b5ea7a7da7199b01ce5179e55cc25b82b3707a6 100644 (file)
@@ -542,7 +542,6 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
        ret = dmaengine_slave_config(dma->chan_rx, &cfg);
        if (ret) {
                dev_err(dev, "can't configure rx dma channel\n");
-               ret = -EINVAL;
                goto err_slave_config;
        }
 
@@ -550,7 +549,6 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
        ret = dmaengine_slave_config(dma->chan_tx, &cfg);
        if (ret) {
                dev_err(dev, "can't configure tx dma channel\n");
-               ret = -EINVAL;
                goto err_slave_config;
        }