diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-09-01 17:27:13 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-08 18:19:31 +0100 |
commit | 7708aff1e2ebc8fdccdd61cf9ab8576a66989166 (patch) | |
tree | 380da57e5950c03ab4d6e7ec7237f2adf6f20fd9 /drivers/spi/spi-tegra20-slink.c | |
parent | 68fffc191ed19ea5618285b128e6048d1536e680 (diff) | |
download | linux-7708aff1e2ebc8fdccdd61cf9ab8576a66989166.tar.bz2 |
spi: tegra20: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200901152713.18629-11-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-tegra20-slink.c')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index a07b72e9c344..a0810765d4e5 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -600,13 +600,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi, struct dma_slave_config dma_sconfig; dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx"); - if (IS_ERR(dma_chan)) { - ret = PTR_ERR(dma_chan); - if (ret != -EPROBE_DEFER) - dev_err(tspi->dev, - "Dma channel is not available: %d\n", ret); - return ret; - } + if (IS_ERR(dma_chan)) + return dev_err_probe(tspi->dev, PTR_ERR(dma_chan), + "Dma channel is not available\n"); dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size, &dma_phys, GFP_KERNEL); |