summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2013-07-16 17:19:13 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:43:26 +0900
commit9793c9e63d73b805524de4c1de8618965ba93635 (patch)
tree1fe858e1fd2bfd08d525ae66c84f1acb459cc6a1 /drivers
parentc682548ef02cbc84b084e03207e9c6fd71687428 (diff)
downloadlinux-3.10-9793c9e63d73b805524de4c1de8618965ba93635.tar.gz
linux-3.10-9793c9e63d73b805524de4c1de8618965ba93635.tar.bz2
linux-3.10-9793c9e63d73b805524de4c1de8618965ba93635.zip
power: charger-manager: regulator_get() never returns NULL.
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>
Diffstat (limited to 'drivers')
-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 3264fd83781..4092bd8c277 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -1243,11 +1243,10 @@ static int charger_manager_register_extcon(struct charger_manager *cm)
charger->consumer = regulator_get(cm->dev,
charger->regulator_name);
- if (charger->consumer == NULL) {
+ if (IS_ERR(charger->consumer)) {
dev_err(cm->dev, "Cannot find charger(%s)n",
charger->regulator_name);
- ret = -EINVAL;
- goto err;
+ return PTR_ERR(charger->consumer);
}
charger->cm = cm;