diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/max77802.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c index f8f06ece2f3c..d076df1d2166 100644 --- a/drivers/regulator/max77802.c +++ b/drivers/regulator/max77802.c | |||
@@ -606,7 +606,13 @@ static int max77802_pmic_probe(struct platform_device *pdev) | |||
606 | config.of_node = pdata->regulators[i].of_node; | 606 | config.of_node = pdata->regulators[i].of_node; |
607 | 607 | ||
608 | ret = regmap_read(iodev->regmap, regulators[i].enable_reg, &val); | 608 | ret = regmap_read(iodev->regmap, regulators[i].enable_reg, &val); |
609 | val = val >> shift & MAX77802_OPMODE_MASK; | 609 | if (ret < 0) { |
610 | dev_warn(&pdev->dev, | ||
611 | "cannot read current mode for %d\n", i); | ||
612 | val = MAX77802_OPMODE_NORMAL; | ||
613 | } else { | ||
614 | val = val >> shift & MAX77802_OPMODE_MASK; | ||
615 | } | ||
610 | 616 | ||
611 | /* | 617 | /* |
612 | * If the regulator is disabled and the system warm rebooted, | 618 | * If the regulator is disabled and the system warm rebooted, |