Commit b9c0b785 authored by Mark Brown's avatar Mark Brown

spi: fsl-dspi: A couple of error handling

Merge series from andy.shevchenko@gmail.com:

A couple of error handling improvements here:
- unshadowing error code from dmaengine_slave_config()
- making error messages uniform
parents 07d67493 51b8e79c
...@@ -502,15 +502,12 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr) ...@@ -502,15 +502,12 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
return -ENOMEM; return -ENOMEM;
dma->chan_rx = dma_request_chan(dev, "rx"); dma->chan_rx = dma_request_chan(dev, "rx");
if (IS_ERR(dma->chan_rx)) { if (IS_ERR(dma->chan_rx))
return dev_err_probe(dev, PTR_ERR(dma->chan_rx), return dev_err_probe(dev, PTR_ERR(dma->chan_rx), "rx dma channel not available\n");
"rx dma channel not available\n");
}
dma->chan_tx = dma_request_chan(dev, "tx"); dma->chan_tx = dma_request_chan(dev, "tx");
if (IS_ERR(dma->chan_tx)) { if (IS_ERR(dma->chan_tx)) {
ret = PTR_ERR(dma->chan_tx); ret = dev_err_probe(dev, PTR_ERR(dma->chan_tx), "tx dma channel not available\n");
dev_err_probe(dev, ret, "tx dma channel not available\n");
goto err_tx_channel; goto err_tx_channel;
} }
...@@ -541,16 +538,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr) ...@@ -541,16 +538,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
cfg.direction = DMA_DEV_TO_MEM; cfg.direction = DMA_DEV_TO_MEM;
ret = dmaengine_slave_config(dma->chan_rx, &cfg); ret = dmaengine_slave_config(dma->chan_rx, &cfg);
if (ret) { if (ret) {
dev_err(dev, "can't configure rx dma channel\n"); dev_err_probe(dev, ret, "can't configure rx dma channel\n");
ret = -EINVAL;
goto err_slave_config; goto err_slave_config;
} }
cfg.direction = DMA_MEM_TO_DEV; cfg.direction = DMA_MEM_TO_DEV;
ret = dmaengine_slave_config(dma->chan_tx, &cfg); ret = dmaengine_slave_config(dma->chan_tx, &cfg);
if (ret) { if (ret) {
dev_err(dev, "can't configure tx dma channel\n"); dev_err_probe(dev, ret, "can't configure tx dma channel\n");
ret = -EINVAL;
goto err_slave_config; goto err_slave_config;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment