mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
power: supply: bd71828: Do not hide errors
The bd71828 reports success / continues operation even when some regmap
operations fail. This can lead incorrect data to be reported.
Return appropriate errors when operations fail.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 5bff79dad2 ("power: supply: Add bd718(15/28/78) charger driver")
Tested-by: Kalle Niemi <kaleposti@gmail.com>
Link: https://patch.msgid.link/22db56cf35252d2d8f67828a0554e8daac7ae251.1786356145.git.mazziesaccount@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
6605209ceb
commit
a3c841e420
|
|
@ -456,8 +456,10 @@ static int bd71828_charger_get_property(struct power_supply *psy,
|
|||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_ONLINE:
|
||||
ret = get_chg_online(pwr, &online);
|
||||
if (!ret)
|
||||
val->intval = online;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val->intval = online;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
|
||||
ret = bd7182x_read16_himask(pwr, pwr->regs->vdcin,
|
||||
|
|
@ -1218,7 +1220,9 @@ static int bd71828_power_probe(struct platform_device *pdev)
|
|||
return dev_err_probe(&pdev->dev, ret, "sense resistor missing\n");
|
||||
|
||||
dev_set_drvdata(&pdev->dev, pwr);
|
||||
bd71828_init_hardware(pwr);
|
||||
ret = bd71828_init_hardware(pwr);
|
||||
if (ret)
|
||||
return dev_err_probe(&pdev->dev, ret, "hardware init failed\n");
|
||||
|
||||
bat_cfg.drv_data = pwr;
|
||||
bat_cfg.fwnode = dev_fwnode(&pdev->dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user