提交 d1d2c290 编写于 作者: D Dan Carpenter 提交者: Eduardo Valentin

thermal: armada: fix a test in probe()

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

Fixes: 3d4e5184 ("thermal: armada: convert driver to syscon register accesses")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
上级 b6ad3981
...@@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev, ...@@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
/* First memory region points towards the status register */ /* First memory region points towards the status register */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (IS_ERR(res)) if (!res)
return PTR_ERR(res); return -EIO;
/* /*
* Edit the resource start address and length to map over all the * Edit the resource start address and length to map over all the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册