mtd: rawnand: cadence: fix error code in cadence_nand_init()
Replace dma_request_channel() with dma_request_chan_by_mask() and use
helper functions to return proper error code instead of fixed -EBUSY.
Fixes: ec4ba01e89
("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
2014c95afe
commit
2b9df00cde
1 changed files with 4 additions and 5 deletions
|
@ -2904,11 +2904,10 @@ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
|
|||
dma_cap_set(DMA_MEMCPY, mask);
|
||||
|
||||
if (cdns_ctrl->caps1->has_dma) {
|
||||
cdns_ctrl->dmac = dma_request_channel(mask, NULL, NULL);
|
||||
if (!cdns_ctrl->dmac) {
|
||||
dev_err(cdns_ctrl->dev,
|
||||
"Unable to get a DMA channel\n");
|
||||
ret = -EBUSY;
|
||||
cdns_ctrl->dmac = dma_request_chan_by_mask(&mask);
|
||||
if (IS_ERR(cdns_ctrl->dmac)) {
|
||||
ret = dev_err_probe(cdns_ctrl->dev, PTR_ERR(cdns_ctrl->dmac),
|
||||
"%d: Failed to get a DMA channel\n", ret);
|
||||
goto disable_irq;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue