mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-24 14:34:46 +07:00
mtd: rawnand: gpmi: 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: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-2-peter.ujfalusi@ti.com
This commit is contained in:
parent
49f1c33076
commit
7cd8c0adb4
@ -1148,20 +1148,21 @@ static int acquire_dma_channels(struct gpmi_nand_data *this)
|
|||||||
{
|
{
|
||||||
struct platform_device *pdev = this->pdev;
|
struct platform_device *pdev = this->pdev;
|
||||||
struct dma_chan *dma_chan;
|
struct dma_chan *dma_chan;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
/* request dma channel */
|
/* request dma channel */
|
||||||
dma_chan = dma_request_slave_channel(&pdev->dev, "rx-tx");
|
dma_chan = dma_request_chan(&pdev->dev, "rx-tx");
|
||||||
if (!dma_chan) {
|
if (IS_ERR(dma_chan)) {
|
||||||
dev_err(this->dev, "Failed to request DMA channel.\n");
|
ret = PTR_ERR(dma_chan);
|
||||||
goto acquire_err;
|
if (ret != -EPROBE_DEFER)
|
||||||
|
dev_err(this->dev, "DMA channel request failed: %d\n",
|
||||||
|
ret);
|
||||||
|
release_dma_channels(this);
|
||||||
|
} else {
|
||||||
|
this->dma_chans[0] = dma_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->dma_chans[0] = dma_chan;
|
return ret;
|
||||||
return 0;
|
|
||||||
|
|
||||||
acquire_err:
|
|
||||||
release_dma_channels(this);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gpmi_get_clks(struct gpmi_nand_data *this)
|
static int gpmi_get_clks(struct gpmi_nand_data *this)
|
||||||
|
Loading…
Reference in New Issue
Block a user