Thread (22 messages) 22 messages, 5 authors, 2016-06-01

Re: [patch] PM / devfreq: exynos-nocp: Checking for IS_ERR instead of NULL

From: Chanwoo Choi <cw00.choi@samsung.com>
Date: 2016-05-18 10:57:28
Also in: linux-pm, linux-samsung-soc

Hi Dan,

On 2016년 05월 18일 19:37, Dan Carpenter wrote:
quoted hunk ↗ jump to hunk
The platform_get_resource() function returns NULL on error, it never
returns error pointers.

Fixes: 0179a913875a ('PM / devfreq: event: Add new Exynos NoC probe driver')
Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/devfreq/event/exynos-nocp.c b/drivers/devfreq/event/exynos-nocp.c
index 6b6a5f3..03b35d5 100644
--- a/drivers/devfreq/event/exynos-nocp.c
+++ b/drivers/devfreq/event/exynos-nocp.c
@@ -220,8 +220,8 @@ static int exynos_nocp_parse_dt(struct platform_device *pdev,
 
 	/* Maps the memory mapped IO to control nocp register */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (IS_ERR(res))
-		return PTR_ERR(res);
+	if (!res)
+		return -ENXIO;
 
 	base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(base))
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

Thanks,
Chanwoo Choi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help