From 04063a011f2f35c37e1146c736e6d4ad402a8557 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 25 Sep 2017 13:21:33 +0300 Subject: 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 Signed-off-by: Mark Brown --- drivers/spi/spi-sprd-adi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 0d481f8..bff6ef1 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; } -- cgit v1.1