summaryrefslogtreecommitdiff
path: root/drivers/power/supply/ab8500_charger.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-10-21 20:49:37 +0300
committerSebastian Reichel <sre@kernel.org>2019-10-28 00:33:07 +0300
commitf457055a7922154bb786e5d55f75b461fa645e9a (patch)
treee996a1de9216337a7b69e276d8ab412e9cde01c3 /drivers/power/supply/ab8500_charger.c
parente3da2ce04e120b4b035793f6eb87b459a505e88b (diff)
downloadlinux-f457055a7922154bb786e5d55f75b461fa645e9a.tar.xz
power: supply: ab8500_charger: Fix inconsistent IS_ERR and PTR_ERR
Fix inconsistent IS_ERR and PTR_ERR in ab8500_charger_probe(). The proper pointer to be passed as argument is di->adc_main_charger_c This bug was detected with the help of Coccinelle. Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/ab8500_charger.c')
-rw-r--r--drivers/power/supply/ab8500_charger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index ff2bb4411a22..8a0f9d769690 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3393,7 +3393,7 @@ static int ab8500_charger_probe(struct platform_device *pdev)
if (PTR_ERR(di->adc_main_charger_c) == -ENODEV)
return -EPROBE_DEFER;
dev_err(&pdev->dev, "failed to get ADC main charger current\n");
- return PTR_ERR(di->adc_main_charger_v);
+ return PTR_ERR(di->adc_main_charger_c);
}
di->adc_vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v");
if (IS_ERR(di->adc_vbus_v)) {