Skip to content

Commit 2b9df00

Browse files
rabaramiquelraynal
authored andcommitted
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: ec4ba01 ("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>
1 parent 2014c95 commit 2b9df00

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/mtd/nand/raw/cadence-nand-controller.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,11 +2904,10 @@ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
29042904
dma_cap_set(DMA_MEMCPY, mask);
29052905

29062906
if (cdns_ctrl->caps1->has_dma) {
2907-
cdns_ctrl->dmac = dma_request_channel(mask, NULL, NULL);
2908-
if (!cdns_ctrl->dmac) {
2909-
dev_err(cdns_ctrl->dev,
2910-
"Unable to get a DMA channel\n");
2911-
ret = -EBUSY;
2907+
cdns_ctrl->dmac = dma_request_chan_by_mask(&mask);
2908+
if (IS_ERR(cdns_ctrl->dmac)) {
2909+
ret = dev_err_probe(cdns_ctrl->dev, PTR_ERR(cdns_ctrl->dmac),
2910+
"%d: Failed to get a DMA channel\n", ret);
29122911
goto disable_irq;
29132912
}
29142913
}

0 commit comments

Comments
 (0)