summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/mt6359-regulator.c
diff options
context:
space:
mode:
authorSen Chu <sen.chu@mediatek.com>2023-05-18 12:06:46 +0800
committerMark Brown <broonie@kernel.org>2023-05-18 19:24:47 +0900
commita511637502b1caa135046d0f8fdabd55a31af8ef (patch)
tree6dc30fc25f6851dfa5217356c48f0896135c096f /drivers/regulator/mt6359-regulator.c
parent2bf1c45be3b8f3a3f898d0756c1282f09719debd (diff)
downloadlinux-stable-a511637502b1caa135046d0f8fdabd55a31af8ef.tar.gz
linux-stable-a511637502b1caa135046d0f8fdabd55a31af8ef.tar.bz2
linux-stable-a511637502b1caa135046d0f8fdabd55a31af8ef.zip
regulator: mt6359: add read check for PMIC MT6359
Add hardware version read check for PMIC MT6359 Signed-off-by: Sen Chu <sen.chu@mediatek.com Fixes: 4cfc96547512 ("regulator: mt6359: Add support for MT6359P regulator") Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230518040646.8730-1-sen.chu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
Diffstat (limited to 'drivers/regulator/mt6359-regulator.c')
-rw-r--r--drivers/regulator/mt6359-regulator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/mt6359-regulator.c b/drivers/regulator/mt6359-regulator.c
index 1849566784ab..3eb86ec21d08 100644
--- a/drivers/regulator/mt6359-regulator.c
+++ b/drivers/regulator/mt6359-regulator.c
@@ -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