linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb
@ 2022-06-02  5:44 cy_huang
  2022-06-06 17:28 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: cy_huang @ 2022-06-02  5:44 UTC (permalink / raw)
  To: broonie; +Cc: lgirdwood, cy_huang, linux-kernel

From: ChiYuan Huang <cy_huang@richtek.com>

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>
---
 drivers/regulator/rt5190a-regulator.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/rt5190a-regulator.c b/drivers/regulator/rt5190a-regulator.c
index 155d4af..4a3397b 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:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-06 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-02  5:44 [PATCH] regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb cy_huang
2022-06-06 17:28 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).