soc: ixp4xx: qmgr: Fix an NULL vs IS_ERR() check in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 6 May 2019 06:31:08 +0000 (08:31 +0200)
committerOlof Johansson <olof@lixom.net>
Thu, 16 May 2019 17:53:11 +0000 (10:53 -0700)
The devm_ioremap_resource() function doesn't retunr NULL, it returns
error pointers.

Fixes: ecc133c6da60 ("soc: ixp4xx: qmgr: Pass resources")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/soc/ixp4xx/ixp4xx-qmgr.c

index 13a8a13c9b01d7587cb793c665c405c48f15484d..bb90670ec1609d704cc3fca390678cb4b9242d5a 100644 (file)
@@ -385,8 +385,8 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
        if (!res)
                return -ENODEV;
        qmgr_regs = devm_ioremap_resource(dev, res);
-       if (!qmgr_regs)
-               return -ENOMEM;
+       if (IS_ERR(qmgr_regs))
+               return PTR_ERR(qmgr_regs);
 
        irq1 = platform_get_irq(pdev, 0);
        if (irq1 <= 0)