diff mbox series

[3/6] power: supply: charger-manager: Fix incorrect return value

Message ID edef76d756eeae2708f5a23f4d8f1f742fac76a7.1542362262.git.baolin.wang@linaro.org
State Accepted
Commit f25a646fbe2051527ad9721853e892d13a99199e
Headers show
Series [1/6] power: supply: charger-manager: Remove unused index counting | expand

Commit Message

(Exiting) Baolin Wang Nov. 16, 2018, 11:01 a.m. UTC
Fix incorrect return value.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

---
 drivers/power/supply/charger-manager.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
1.7.9.5

Comments

Sebastian Reichel Dec. 5, 2018, 8:36 p.m. UTC | #1
Hi,

On Fri, Nov 16, 2018 at 07:01:10PM +0800, Baolin Wang wrote:
> Fix incorrect return value.

> 

> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

> ---


Thanks, queued.

-- Sebastian

>  drivers/power/supply/charger-manager.c |    3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c

> index bd6c450..a52bc77 100644

> --- a/drivers/power/supply/charger-manager.c

> +++ b/drivers/power/supply/charger-manager.c

> @@ -1212,7 +1212,6 @@ static int charger_extcon_init(struct charger_manager *cm,

>  	if (ret < 0) {

>  		pr_info("Cannot register extcon_dev for %s(cable: %s)\n",

>  			cable->extcon_name, cable->name);

> -		ret = -EINVAL;

>  	}

>  

>  	return ret;

> @@ -1633,7 +1632,7 @@ static int charger_manager_probe(struct platform_device *pdev)

>  

>  	if (IS_ERR(desc)) {

>  		dev_err(&pdev->dev, "No platform data (desc) found\n");

> -		return -ENODEV;

> +		return PTR_ERR(desc);

>  	}

>  

>  	cm = devm_kzalloc(&pdev->dev, sizeof(*cm), GFP_KERNEL);

> -- 

> 1.7.9.5

>
diff mbox series

Patch

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index bd6c450..a52bc77 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1212,7 +1212,6 @@  static int charger_extcon_init(struct charger_manager *cm,
 	if (ret < 0) {
 		pr_info("Cannot register extcon_dev for %s(cable: %s)\n",
 			cable->extcon_name, cable->name);
-		ret = -EINVAL;
 	}
 
 	return ret;
@@ -1633,7 +1632,7 @@  static int charger_manager_probe(struct platform_device *pdev)
 
 	if (IS_ERR(desc)) {
 		dev_err(&pdev->dev, "No platform data (desc) found\n");
-		return -ENODEV;
+		return PTR_ERR(desc);
 	}
 
 	cm = devm_kzalloc(&pdev->dev, sizeof(*cm), GFP_KERNEL);