aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/charger-manager.c
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2013-06-25 01:18:14 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-06-28 21:37:03 -0400
commit5a6c2208455f25b3e6f939adc2da59aa00d4806e (patch)
treeecde95c291fb8598cfadf24f5245d406abfbc51c /drivers/power/charger-manager.c
parent3cc9d26966ea02f71258ab0553ebd3388f40533a (diff)
charger-manager: Fix regulator_get() return check
This patch fixes return value checking of regulator_get() in charger-manager driver. The API, regulator_get(), returns ERR_PTR() when it fails to get regulator with given name, not NULL. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power/charger-manager.c')
-rw-r--r--drivers/power/charger-manager.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 8ad9698b55a9..e30e847600bb 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -1239,11 +1239,10 @@ static int charger_manager_register_extcon(struct charger_manager *cm)
1239 1239
1240 charger->consumer = regulator_get(cm->dev, 1240 charger->consumer = regulator_get(cm->dev,
1241 charger->regulator_name); 1241 charger->regulator_name);
1242 if (charger->consumer == NULL) { 1242 if (IS_ERR(charger->consumer)) {
1243 dev_err(cm->dev, "Cannot find charger(%s)\n", 1243 dev_err(cm->dev, "Cannot find charger(%s)\n",
1244 charger->regulator_name); 1244 charger->regulator_name);
1245 ret = -EINVAL; 1245 return PTR_ERR(charger->consumer);
1246 goto err;
1247 } 1246 }
1248 charger->cm = cm; 1247 charger->cm = cm;
1249 1248