aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-07-14 08:06:45 -0400
committerBrian Norris <computersforpeace@gmail.com>2016-07-15 20:10:46 -0400
commitde3bfc4a16165cfc5f1504981f836d39a5f39a64 (patch)
tree4becaa2b92e9a7082029480765ea40c9b5da478d /drivers/mtd
parent1ed106914abdd6d73f7efba333cd6e044c59b316 (diff)
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: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel information from DT') Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/omap2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 83b9091233d4..3dfd512b198b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1920,9 +1920,9 @@ static int omap_nand_probe(struct platform_device *pdev)
1920 dma_cap_set(DMA_SLAVE, mask); 1920 dma_cap_set(DMA_SLAVE, mask);
1921 info->dma = dma_request_chan(pdev->dev.parent, "rxtx"); 1921 info->dma = dma_request_chan(pdev->dev.parent, "rxtx");
1922 1922
1923 if (!info->dma) { 1923 if (IS_ERR(info->dma)) {
1924 dev_err(&pdev->dev, "DMA engine request failed\n"); 1924 dev_err(&pdev->dev, "DMA engine request failed\n");
1925 err = -ENXIO; 1925 err = PTR_ERR(info->dma);
1926 goto return_error; 1926 goto return_error;
1927 } else { 1927 } else {
1928 struct dma_slave_config cfg; 1928 struct dma_slave_config cfg;