summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-orion.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-06-13 17:32:23 +0300
committerMark Brown <broonie@kernel.org>2016-06-13 18:36:40 +0300
commit57c624ae1c0aa631f11768992a74998c531a7fee (patch)
tree28b16d9afdbe3f4d0d95a85bf3603abba0ac2e57 /drivers/spi/spi-orion.c
parentb3c195b3a75b0aff9ede850ba2208cd1f40a702b (diff)
downloadlinux-57c624ae1c0aa631f11768992a74998c531a7fee.tar.xz
spi: orion: Fix return value check in orion_spi_probe()
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>
Diffstat (limited to 'drivers/spi/spi-orion.c')
-rw-r--r--drivers/spi/spi-orion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index d0d9c8682b32..ded37025b445 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -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;