summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/rt5190a-regulator.c
diff options
context:
space:
mode:
authorChiYuan Huang <cy_huang@richtek.com>2022-06-02 07:44:06 +0200
committerMark Brown <broonie@kernel.org>2022-06-06 13:39:10 +0200
commit5f7202d827b8d39146b27c2f813849b1ad437beb (patch)
treea7daed489bef674d5fd92140320961ff8f74b5a7 /drivers/regulator/rt5190a-regulator.c
parentregulator: mp5416: add support for MP5496 (diff)
downloadlinux-5f7202d827b8d39146b27c2f813849b1ad437beb.tar.xz
linux-5f7202d827b8d39146b27c2f813849b1ad437beb.zip
regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb
If the node for the match name cannot be found, 'of_regulator_match' will returns init_data as NULL for this regulator. Add the check for the init_data. If it's NULL, make 'rt5190a_of_parse_cb' function directly return. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1654148646-12182-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/rt5190a-regulator.c')
-rw-r--r--drivers/regulator/rt5190a-regulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/rt5190a-regulator.c b/drivers/regulator/rt5190a-regulator.c
index 155d4afd00b1..4a3397b32582 100644
--- a/drivers/regulator/rt5190a-regulator.c
+++ b/drivers/regulator/rt5190a-regulator.c
@@ -224,6 +224,9 @@ static int rt5190a_of_parse_cb(struct rt5190a_priv *priv, int rid,
bool latchup_enable;
unsigned int mask = RT5190A_RID_BITMASK(rid), val;
+ if (!init_data)
+ return 0;
+
switch (rid) {
case RT5190A_IDX_BUCK1:
case RT5190A_IDX_BUCK4: