Skip to contentSkip to conversation

regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb

PATCH In review cy_huang 2 participants 2 messages Jun 2, 2022 – Jun 6, 2022 Voltage and current regulator framework

lore
Share & tools
lore

cy_huang

author
#0 lore raw

PATCH 1/1 regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb

From: ChiYuan Huang <[email protected]>

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.

---
 drivers/regulator/rt5190a-regulator.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/regulator/rt5190a-regulator.c +3 -0
index 155d4af..4a3397b 100644
@@ -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:
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 9 lines · cy_huang

From: ChiYuan Huang <[email protected]>

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb

      commit: 5f7202d827b8d39146b27c2f813849b1ad437beb

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark