summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-09-19 13:35:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-01 11:16:54 +0300
commit733fddc346515d1d44c577efa7d36cb02fb57a3f (patch)
treed4051bbd348c943d5bb12a59d12fad4497cdae51 /drivers
parentbb925b9bece25e3c53fb06dc0cbcc4f3e40b196e (diff)
downloadlinux-733fddc346515d1d44c577efa7d36cb02fb57a3f.tar.xz
thermal: armada: fix a test in probe()
[ 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/armada_thermal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index e16b3cb1808c..1c9830b2c84d 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -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