summaryrefslogtreecommitdiff
path: root/drivers/thermal/armada_thermal.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-09-19 13:35:00 +0300
committerEduardo Valentin <edubezval@gmail.com>2018-10-22 17:38:24 -0700
commitd1d2c290b3c04b65fa6132eeebe50a070746d8f6 (patch)
treeaada788a9a6c3f3fb429a45e5d9da0f1730c14a9 /drivers/thermal/armada_thermal.c
parentb6ad3981ff94b415d48399e949db0bdfbe360736 (diff)
thermal: armada: fix a test in probe()
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>
Diffstat (limited to 'drivers/thermal/armada_thermal.c')
-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 2c2f6d93034e..92f67d40f2e9 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