summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-09-25 13:21:33 +0300
committerMark Brown <broonie@kernel.org>2017-09-25 19:08:20 +0300
commit04063a011f2f35c37e1146c736e6d4ad402a8557 (patch)
treedc6db39ab7ab1afafc3910f8f40173fcb3551821
parent7e2903cb91df1a8b0a202a7cf5c9e3d2f654bc57 (diff)
downloadlinux-04063a011f2f35c37e1146c736e6d4ad402a8557.tar.xz
spi: sprd-adi: checking for NULL instead of IS_ERR()
devm_ioremap_resource() returns error pointers, it never returns NULL. Fixes: 7e2903cb91df ("spi: Add ADI driver for Spreadtrum platform") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-sprd-adi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index 0d481f8a46c2..bff6ef1caad7 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -341,8 +341,8 @@ static int sprd_adi_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
sadi->base = devm_ioremap_resource(&pdev->dev, res);
- if (!sadi->base) {
- ret = -ENOMEM;
+ if (IS_ERR(sadi->base)) {
+ ret = PTR_ERR(sadi->base);
goto put_ctlr;
}