diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-09-19 12:35:00 +0200 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2018-10-23 02:38:24 +0200 |
commit | d1d2c290b3c04b65fa6132eeebe50a070746d8f6 (patch) | |
tree | aada788a9a6c3f3fb429a45e5d9da0f1730c14a9 | |
parent | thermal: imx: handle error path in one place to save duplicated code (diff) | |
download | linux-d1d2c290b3c04b65fa6132eeebe50a070746d8f6.tar.xz linux-d1d2c290b3c04b65fa6132eeebe50a070746d8f6.zip |
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>
-rw-r--r-- | drivers/thermal/armada_thermal.c | 4 |
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 |