]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
thermal: armada: fix a test in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 19 Sep 2018 10:35:00 +0000 (13:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:16:54 +0000 (09:16 +0100)
[ Upstream commit d1d2c290b3c04b65fa6132eeebe50a070746d8f6 ]

The platform_get_resource() function doesn't return error pointers, it
returns NULL on error.

Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/armada_thermal.c

index e16b3cb1808c589dc8d2e50e426e9f973138429f..1c9830b2c84da97d808a2cd099f3d9ded3175edc 100644 (file)
@@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
 
        /* First memory region points towards the status register */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (IS_ERR(res))
-               return PTR_ERR(res);
+       if (!res)
+               return -EIO;
 
        /*
         * Edit the resource start address and length to map over all the