mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe()
[ Upstream commite7a97528e3] If dma_request_channel() fails then the probe fails and it should return a negative error code, but currently it returns success. fixes:4774fb0a48("mtd: nand/fsmc: Add DMA support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/YCqaOZ83OvPOzLwh@mwanda Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
82a0cadf6f
commit
c8f3837c51
@@ -1078,11 +1078,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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user