projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94c7073
)
power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
author
Hans de Goede
<hdegoede@redhat.com>
Wed, 14 Dec 2016 16:38:50 +0000
(17:38 +0100)
committer
Sebastian Reichel
<sre@kernel.org>
Wed, 4 Jan 2017 20:59:08 +0000
(21:59 +0100)
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>
drivers/power/supply/axp288_fuel_gauge.c
patch
|
blob
|
history
diff --git
a/drivers/power/supply/axp288_fuel_gauge.c
b/drivers/power/supply/axp288_fuel_gauge.c
index
539eb41
..
86bb4d0
100644
(file)
--- a/
drivers/power/supply/axp288_fuel_gauge.c
+++ b/
drivers/power/supply/axp288_fuel_gauge.c
@@
-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;
}