Commit de3bfc4a authored by Wei Yongjun's avatar Wei Yongjun Committed by Brian Norris

mtd: nand: omap2: fix return value check in omap_nand_probe()

In case of error, the function dma_request_chan() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: aa7abd31 ('mtd: nand: omap2: Support parsing dma channel
information from DT')
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 1ed10691
...@@ -1920,9 +1920,9 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -1920,9 +1920,9 @@ static int omap_nand_probe(struct platform_device *pdev)
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
info->dma = dma_request_chan(pdev->dev.parent, "rxtx"); info->dma = dma_request_chan(pdev->dev.parent, "rxtx");
if (!info->dma) { if (IS_ERR(info->dma)) {
dev_err(&pdev->dev, "DMA engine request failed\n"); dev_err(&pdev->dev, "DMA engine request failed\n");
err = -ENXIO; err = PTR_ERR(info->dma);
goto return_error; goto return_error;
} else { } else {
struct dma_slave_config cfg; struct dma_slave_config cfg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment