summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-05-18 10:43:46 +0300
committerSebastian Reichel <sre@kernel.org>2017-06-08 13:05:27 +0200
commite12854174bbe5bab7b8f3e378e05dc0700112112 (patch)
tree48498576e469c03d523ef8cc683dd09dd2af5e27 /drivers/power
parent105df60f207301631258c966d82d99f826508b41 (diff)
downloadblackbird-op-linux-e12854174bbe5bab7b8f3e378e05dc0700112112.tar.gz
blackbird-op-linux-e12854174bbe5bab7b8f3e378e05dc0700112112.zip
power: supply: ltc3651-charger: fix some error codes in probe
There are several cut and past bugs here. ltc3651_charger->charger is NULL at this point, so we return success instead of the intended error codes. Fixes: c94d4ed017ae ("power: supply: Add ltc3651-charger driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> [Wei Yongjun found the same issue independently] Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/ltc3651-charger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/supply/ltc3651-charger.c b/drivers/power/supply/ltc3651-charger.c
index 5f8d5c0b5721..eea63ff211c4 100644
--- a/drivers/power/supply/ltc3651-charger.c
+++ b/drivers/power/supply/ltc3651-charger.c
@@ -110,21 +110,21 @@ static int ltc3651_charger_probe(struct platform_device *pdev)
ltc3651_charger->acpr_gpio = devm_gpiod_get(&pdev->dev,
"lltc,acpr", GPIOD_IN);
if (IS_ERR(ltc3651_charger->acpr_gpio)) {
- ret = PTR_ERR(ltc3651_charger->charger);
+ ret = PTR_ERR(ltc3651_charger->acpr_gpio);
dev_err(&pdev->dev, "Failed to acquire acpr GPIO: %d\n", ret);
return ret;
}
ltc3651_charger->fault_gpio = devm_gpiod_get_optional(&pdev->dev,
"lltc,fault", GPIOD_IN);
if (IS_ERR(ltc3651_charger->fault_gpio)) {
- ret = PTR_ERR(ltc3651_charger->charger);
+ ret = PTR_ERR(ltc3651_charger->fault_gpio);
dev_err(&pdev->dev, "Failed to acquire fault GPIO: %d\n", ret);
return ret;
}
ltc3651_charger->chrg_gpio = devm_gpiod_get_optional(&pdev->dev,
"lltc,chrg", GPIOD_IN);
if (IS_ERR(ltc3651_charger->chrg_gpio)) {
- ret = PTR_ERR(ltc3651_charger->charger);
+ ret = PTR_ERR(ltc3651_charger->chrg_gpio);
dev_err(&pdev->dev, "Failed to acquire chrg GPIO: %d\n", ret);
return ret;
}
OpenPOWER on IntegriCloud