summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2018-12-21 00:29:19 -0600
committerMark Brown <broonie@kernel.org>2018-12-21 11:04:59 +0000
commitcd07e3701fa6a4c68f8493ee1d12caa18d46ec6a (patch)
tree18a4c4cd9fa2f910e8ad1c8b25860d0b39fc6c6f
parent77ea906082dcfa63ad8a07ace6d5033d30c4175b (diff)
downloadtalos-obmc-linux-cd07e3701fa6a4c68f8493ee1d12caa18d46ec6a.tar.gz
talos-obmc-linux-cd07e3701fa6a4c68f8493ee1d12caa18d46ec6a.zip
regulator: tps65910: fix a missing check of return value
tps65910_reg_set_bits() may fail. The fix checks if it fails, and if so, returns with its error code. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/tps65910-regulator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 02ccdaa226a7..5ebb6ee73f07 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1102,8 +1102,10 @@ static int tps65910_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pmic);
/* Give control of all register to control port */
- tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL,
+ err = tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL,
DEVCTRL_SR_CTL_I2C_SEL_MASK);
+ if (err < 0)
+ return err;
switch (tps65910_chip_id(tps65910)) {
case TPS65910:
OpenPOWER on IntegriCloud