mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
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>
This commit is contained in:
parent
68fffc191e
commit
7708aff1e2
1 changed files with 3 additions and 7 deletions
|
@ -600,13 +600,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi,
|
||||||
struct dma_slave_config dma_sconfig;
|
struct dma_slave_config dma_sconfig;
|
||||||
|
|
||||||
dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx");
|
dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx");
|
||||||
if (IS_ERR(dma_chan)) {
|
if (IS_ERR(dma_chan))
|
||||||
ret = PTR_ERR(dma_chan);
|
return dev_err_probe(tspi->dev, PTR_ERR(dma_chan),
|
||||||
if (ret != -EPROBE_DEFER)
|
"Dma channel is not available\n");
|
||||||
dev_err(tspi->dev,
|
|
||||||
"Dma channel is not available: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,
|
dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,
|
||||||
&dma_phys, GFP_KERNEL);
|
&dma_phys, GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue