]> git.itanic.dy.fi Git - linux-stable/blobdiff - drivers/regulator/mt6359-regulator.c
regulator: mt6359: add read check for PMIC MT6359
[linux-stable] / drivers / regulator / mt6359-regulator.c
index de3b0462832cd3e7777a55ec16ce181a67a6c5e9..f94f87c5407ae6485c79e9206325f5b97d451e6c 100644 (file)
@@ -951,9 +951,12 @@ static int mt6359_regulator_probe(struct platform_device *pdev)
        struct regulator_config config = {};
        struct regulator_dev *rdev;
        struct mt6359_regulator_info *mt6359_info;
-       int i, hw_ver;
+       int i, hw_ver, ret;
+
+       ret = regmap_read(mt6397->regmap, MT6359P_HWCID, &hw_ver);
+       if (ret)
+               return ret;
 
-       regmap_read(mt6397->regmap, MT6359P_HWCID, &hw_ver);
        if (hw_ver >= MT6359P_CHIP_VER)
                mt6359_info = mt6359p_regulators;
        else