From c6738d06a363ac7010a5c3b54e2af1957852cc45 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 26 Aug 2014 13:41:38 +0900 Subject: 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 Acked-by: Myungjoo Ham Signed-off-by: Sebastian Reichel --- drivers/power/charger-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') 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; } -- cgit v1.2.3