Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1328307 > unrolled thread
| Started by | weiyj_lk@163.com |
|---|---|
| First post | 2016-02-06 15:30 +0100 |
| Last post | 2016-02-09 06:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() weiyj_lk@163.com - 2016-02-06 15:30 +0100
Re: [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() Jun Nie <jun.nie@linaro.org> - 2016-02-09 06:10 +0100
| From | weiyj_lk@163.com |
|---|---|
| Date | 2016-02-06 15:30 +0100 |
| Subject | [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() |
| Message-ID | <qZc26-8te-9@gated-at.bofh.it> |
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
index e08574d..2037bcb 100644
--- a/arch/arm/mach-zx/zx296702-pm-domain.c
+++ b/arch/arm/mach-zx/zx296702-pm-domain.c
@@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
}
pcubase = devm_ioremap_resource(&pdev->dev, res);
- if (!pcubase) {
+ if (IS_ERR(pcubase)) {
dev_err(&pdev->dev, "ioremap fail.\n");
- return -EIO;
+ return PTR_ERR(pcubase);
}
for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)
[toc] | [next] | [standalone]
| From | Jun Nie <jun.nie@linaro.org> |
|---|---|
| Date | 2016-02-09 06:10 +0100 |
| Message-ID | <r08IP-7Ps-23@gated-at.bofh.it> |
| In reply to | #1328307 |
On 2016年02月06日 22:24, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_resource() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
> index e08574d..2037bcb 100644
> --- a/arch/arm/mach-zx/zx296702-pm-domain.c
> +++ b/arch/arm/mach-zx/zx296702-pm-domain.c
> @@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
> }
>
> pcubase = devm_ioremap_resource(&pdev->dev, res);
> - if (!pcubase) {
> + if (IS_ERR(pcubase)) {
> dev_err(&pdev->dev, "ioremap fail.\n");
> - return -EIO;
> + return PTR_ERR(pcubase);
> }
>
> for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)
>
Thanks for fixing this issue.
Reviewed-by: Jun Nie <jun.nie@linaro.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web