ARM: zx: Fix error handling
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 30 Oct 2016 08:10:10 +0000 (09:10 +0100)
committerOlof Johansson <olof@lixom.net>
Tue, 8 Nov 2016 03:19:35 +0000 (19:19 -0800)
'devm_ioremap_resource()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-zx/zx296702-pm-domain.c

index e08574d4e2ca509da643b376175fa04adea8e5fd..79dcf25492670c7c1a74eb66bbc47413019a081d 100644 (file)
@@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev)
        }
 
        pcubase = devm_ioremap_resource(&pdev->dev, res);
-       if (!pcubase) {
+       if (IS_ERR(pcubase)) {
                dev_err(&pdev->dev, "ioremap fail.\n");
                return -EIO;
        }