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>
This commit is contained in:
Kangjie Lu 2018-12-21 00:29:19 -06:00 committed by Mark Brown
parent 77ea906082
commit cd07e3701f
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 3 additions and 1 deletions

View File

@ -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: