diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-09 05:03:31 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-04-17 14:04:51 -0400 |
commit | 9c361b1afd9b4b2bba7fa1ffb080c9f5de3ff108 (patch) | |
tree | 4109d70c1db40d9b3668f10bb25c1655a3b5925b /drivers/dma | |
parent | ed1f041842f0c4226a78fcd96ccb8e6a5433ae9d (diff) |
dmaengine: xgene: devm_ioremap() returns NULL on error
The code here is checking for IS_ERR() but devm_ioremap() returns NULL
on error and not an error pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rwxr-xr-x | drivers/dma/xgene-dma.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c index 06d40427aa08..8a369460f562 100755 --- a/drivers/dma/xgene-dma.c +++ b/drivers/dma/xgene-dma.c | |||
@@ -1895,9 +1895,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, | |||
1895 | 1895 | ||
1896 | pdma->csr_dma = devm_ioremap(&pdev->dev, res->start, | 1896 | pdma->csr_dma = devm_ioremap(&pdev->dev, res->start, |
1897 | resource_size(res)); | 1897 | resource_size(res)); |
1898 | if (IS_ERR(pdma->csr_dma)) { | 1898 | if (!pdma->csr_dma) { |
1899 | dev_err(&pdev->dev, "Failed to ioremap csr region"); | 1899 | dev_err(&pdev->dev, "Failed to ioremap csr region"); |
1900 | return PTR_ERR(pdma->csr_dma); | 1900 | return -ENOMEM; |
1901 | } | 1901 | } |
1902 | 1902 | ||
1903 | /* Get DMA ring csr region */ | 1903 | /* Get DMA ring csr region */ |
@@ -1909,9 +1909,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, | |||
1909 | 1909 | ||
1910 | pdma->csr_ring = devm_ioremap(&pdev->dev, res->start, | 1910 | pdma->csr_ring = devm_ioremap(&pdev->dev, res->start, |
1911 | resource_size(res)); | 1911 | resource_size(res)); |
1912 | if (IS_ERR(pdma->csr_ring)) { | 1912 | if (!pdma->csr_ring) { |
1913 | dev_err(&pdev->dev, "Failed to ioremap ring csr region"); | 1913 | dev_err(&pdev->dev, "Failed to ioremap ring csr region"); |
1914 | return PTR_ERR(pdma->csr_ring); | 1914 | return -ENOMEM; |
1915 | } | 1915 | } |
1916 | 1916 | ||
1917 | /* Get DMA ring cmd csr region */ | 1917 | /* Get DMA ring cmd csr region */ |
@@ -1923,9 +1923,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, | |||
1923 | 1923 | ||
1924 | pdma->csr_ring_cmd = devm_ioremap(&pdev->dev, res->start, | 1924 | pdma->csr_ring_cmd = devm_ioremap(&pdev->dev, res->start, |
1925 | resource_size(res)); | 1925 | resource_size(res)); |
1926 | if (IS_ERR(pdma->csr_ring_cmd)) { | 1926 | if (!pdma->csr_ring_cmd) { |
1927 | dev_err(&pdev->dev, "Failed to ioremap ring cmd csr region"); | 1927 | dev_err(&pdev->dev, "Failed to ioremap ring cmd csr region"); |
1928 | return PTR_ERR(pdma->csr_ring_cmd); | 1928 | return -ENOMEM; |
1929 | } | 1929 | } |
1930 | 1930 | ||
1931 | /* Get efuse csr region */ | 1931 | /* Get efuse csr region */ |
@@ -1937,9 +1937,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, | |||
1937 | 1937 | ||
1938 | pdma->csr_efuse = devm_ioremap(&pdev->dev, res->start, | 1938 | pdma->csr_efuse = devm_ioremap(&pdev->dev, res->start, |
1939 | resource_size(res)); | 1939 | resource_size(res)); |
1940 | if (IS_ERR(pdma->csr_efuse)) { | 1940 | if (!pdma->csr_efuse) { |
1941 | dev_err(&pdev->dev, "Failed to ioremap efuse csr region"); | 1941 | dev_err(&pdev->dev, "Failed to ioremap efuse csr region"); |
1942 | return PTR_ERR(pdma->csr_efuse); | 1942 | return -ENOMEM; |
1943 | } | 1943 | } |
1944 | 1944 | ||
1945 | /* Get DMA error interrupt */ | 1945 | /* Get DMA error interrupt */ |