spi: orion: Fix return value check in orion_spi_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 Jun 2016 14:32:23 +0000 (14:32 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 13 Jun 2016 15:36:40 +0000 (16:36 +0100)
In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-orion.c

index d0d9c8682b323eb30b99cb7bdea3db86c642d963..ded37025b445834d0367ef41cac7aa80b2c656cf 100644 (file)
@@ -655,8 +655,8 @@ static int orion_spi_probe(struct platform_device *pdev)
                spi->direct_access[cs].vaddr = devm_ioremap(&pdev->dev,
                                                            r->start,
                                                            PAGE_SIZE);
-               if (IS_ERR(spi->direct_access[cs].vaddr)) {
-                       status = PTR_ERR(spi->direct_access[cs].vaddr);
+               if (!spi->direct_access[cs].vaddr) {
+                       status = -ENOMEM;
                        goto out_rel_clk;
                }
                spi->direct_access[cs].size = PAGE_SIZE;