[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230518040646.8730-1-sen.chu@mediatek.com>
Date: Thu, 18 May 2023 12:06:46 +0800
From: Sen Chu <sen.chu@...iatek.com>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Sen Chu <sen.chu@...iatek.com>
Subject: [PATCH v2] regulator: mt6359: add read check for PMIC MT6359
Add hardware version read check for PMIC MT6359
Signed-off-by: Sen Chu <sen.chu@...iatek.com>
---
Change in v1:
Fix: this should be if (ret)
[Sen Chu <sen.chu@...iatek.com>]
---
---
drivers/regulator/mt6359-regulator.c | 7 +++++--
1 file 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
--
2.18.0
Powered by blists - more mailing lists