Commit 92f0f8ef authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Miquel Raynal

mtd: rawnand: qcom: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

Use using dma_request_chan() directly to return the real error code.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-7-peter.ujfalusi@ti.com
parent 80c3012e
...@@ -2696,24 +2696,36 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc) ...@@ -2696,24 +2696,36 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
return -EIO; return -EIO;
} }
nandc->tx_chan = dma_request_slave_channel(nandc->dev, "tx"); nandc->tx_chan = dma_request_chan(nandc->dev, "tx");
if (!nandc->tx_chan) { if (IS_ERR(nandc->tx_chan)) {
dev_err(nandc->dev, "failed to request tx channel\n"); ret = PTR_ERR(nandc->tx_chan);
ret = -ENODEV; nandc->tx_chan = NULL;
if (ret != -EPROBE_DEFER)
dev_err(nandc->dev,
"tx DMA channel request failed: %d\n",
ret);
goto unalloc; goto unalloc;
} }
nandc->rx_chan = dma_request_slave_channel(nandc->dev, "rx"); nandc->rx_chan = dma_request_chan(nandc->dev, "rx");
if (!nandc->rx_chan) { if (IS_ERR(nandc->rx_chan)) {
dev_err(nandc->dev, "failed to request rx channel\n"); ret = PTR_ERR(nandc->rx_chan);
ret = -ENODEV; nandc->rx_chan = NULL;
if (ret != -EPROBE_DEFER)
dev_err(nandc->dev,
"rx DMA channel request failed: %d\n",
ret);
goto unalloc; goto unalloc;
} }
nandc->cmd_chan = dma_request_slave_channel(nandc->dev, "cmd"); nandc->cmd_chan = dma_request_chan(nandc->dev, "cmd");
if (!nandc->cmd_chan) { if (IS_ERR(nandc->cmd_chan)) {
dev_err(nandc->dev, "failed to request cmd channel\n"); ret = PTR_ERR(nandc->cmd_chan);
ret = -ENODEV; nandc->cmd_chan = NULL;
if (ret != -EPROBE_DEFER)
dev_err(nandc->dev,
"cmd DMA channel request failed: %d\n",
ret);
goto unalloc; goto unalloc;
} }
...@@ -2732,11 +2744,15 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc) ...@@ -2732,11 +2744,15 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
goto unalloc; goto unalloc;
} }
} else { } else {
nandc->chan = dma_request_slave_channel(nandc->dev, "rxtx"); nandc->chan = dma_request_chan(nandc->dev, "rxtx");
if (!nandc->chan) { if (IS_ERR(nandc->chan)) {
dev_err(nandc->dev, ret = PTR_ERR(nandc->chan);
"failed to request slave channel\n"); nandc->chan = NULL;
return -ENODEV; if (ret != -EPROBE_DEFER)
dev_err(nandc->dev,
"rxtx DMA channel request failed: %d\n",
ret);
return ret;
} }
} }
......
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