lkml.org 
[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH -next] ARM: pxa: fix return value check in em_x270_sensor_init()
From
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function regulator_get() 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-pxa/em-x270.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 6915a9f..339b422 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -971,9 +971,9 @@ static int em_x270_sensor_init(void)
gpio_direction_output(cam_reset, 0);

em_x270_camera_ldo = regulator_get(NULL, "vcc cam");
- if (em_x270_camera_ldo == NULL) {
+ if (IS_ERR(em_x270_camera_ldo)) {
gpio_free(cam_reset);
- return -ENODEV;
+ return PTR_ERR(em_x270_camera_ldo);
}

ret = regulator_enable(em_x270_camera_ldo);


\
 
 \ /
  Last update: 2013-12-14 06:01    [W:0.025 / U:25.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site