mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe()
Subsystems (3)
PATCH 1/1 mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe()
If dma_request_channel() fails then the probe fails and it should return a negative error code, but currently it returns success.
Fixes 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/mtd/nand/raw/fsmc_nand.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/fsmc_nand.c +2 -0
@@ -1077,11 +1077,13 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) host->read_dma_chan =dma_request_channel (mask, filter,NULL );if (!host->read_dma_chan) {dev_err (&pdev->dev,"Unable to get read dma channel\n" ); + ret = -ENODEV ; goto disable_clk; } host->write_dma_chan =dma_request_channel (mask, filter,NULL );if (!host->write_dma_chan) {dev_err (&pdev->dev,"Unable to get write dma channel\n" ); + ret = -ENODEV ; goto release_dma_read_chan; } }
Signature · 1 line
2.30.0
Quoted 5 lines · Dan Carpenter
If
dma_request_channel()fails then the probe fails and it should return a negative error code, but currently it returns success.Fixes 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")Signed-off-by Dan Carpenter <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel