summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2014-08-26 08:41:38 +0400
committerSebastian Reichel <sre@kernel.org>2014-09-06 23:02:45 +0400
commitc6738d06a363ac7010a5c3b54e2af1957852cc45 (patch)
tree48b8dbfd5e689a38d6a77348837dceeaea9afe3f /drivers
parentd3ed534cca703b2aaeee9277a5b8063ae6eab1d1 (diff)
downloadlinux-c6738d06a363ac7010a5c3b54e2af1957852cc45.tar.xz
power: charger-manager: Fix checking of wrong return type
This patch fix minor issue about checking wrong return type. The of_cm_parse_desc() return ERR_PTR(errnor number) when some error happen in this function. But, charger_manager_probe() has only checked whether desc is NULL or not. If of_cm_parse_desc() returns ERR_PTR(-ENOMEM), desc isn't NULL but desc is (void *)(-ENOMEM). Althouhg some error happen for parsing DT, charger_manager_probe() can't detect error of desc instance. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/power/charger-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 9e4dab46eefd..a10fb57c209e 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -1677,7 +1677,7 @@ static int charger_manager_probe(struct platform_device *pdev)
}
}
- if (!desc) {
+ if (IS_ERR(desc)) {
dev_err(&pdev->dev, "No platform data (desc) found\n");
return -ENODEV;
}