All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
@ 2016-12-14 16:38 Hans de Goede
  2016-12-14 16:38 ` [PATCH 2/4] power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Hans de Goede @ 2016-12-14 16:38 UTC (permalink / raw)
  To: Sebastian Reichel, Chen-Yu Tsai
  Cc: russianneuromancer @ ya . ru, linux-pm, linux-i2c, Hans de Goede

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>
---
 drivers/power/supply/axp288_fuel_gauge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index 5bdde69..f62f9df 100644
--- 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;
 }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-12-17 15:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14 16:38 [PATCH 1/4] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Hans de Goede
2016-12-14 16:38 ` [PATCH 2/4] power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time Hans de Goede
2016-12-17 14:58   ` Sebastian Reichel
2016-12-14 16:38 ` [PATCH 3/4] power: supply: axp288_fuel_gauge: Read 12 " Hans de Goede
2016-12-17 14:58   ` Sebastian Reichel
2016-12-14 16:38 ` [PATCH 4/4] power: supply: axp288_fuel_gauge: Drop platform_data dependency Hans de Goede
2016-12-17 15:00   ` Sebastian Reichel
2016-12-14 17:01 ` [PATCH 1/4] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Wolfram Sang
2016-12-17 14:57 ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.