mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 15:11:31 +00:00
power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
If reading the register fails, return the actual error code, instead of the uninitialized val variable; Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
This commit is contained in:
parent
94c7073fe3
commit
6f074bc878
@ -169,8 +169,10 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
dev_err(&info->pdev->dev, "axp288 reg read err:%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user