mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
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>
This commit is contained in:
parent
d3ed534cca
commit
c6738d06a3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user