Skip to contentSkip to conversation

regulator: max77693: Skip register regulator if no platform initialization data

PATCH In review Axel Lin 2 participants 2 messages Jun 29, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max77693: Skip register regulator if no platform initialization data

The code in max77693_pmic_dt_parse_rdata() does skip setting rdata if !rmatch[i].init_data. So we may have some empty entries in rdata[]. We need to skip register regulator if no platform initialization data, otherwise we may resiter regulator with invalid settings ( the empty entries of rdata[]).

---
 drivers/regulator/max77693.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/regulator/max77693.c +3 -0
index d45a4dd..6116a49 100644
@@ -265,6 +265,9 @@ static int max77693_pmic_probe(struct platform_device *pdev)
 	for (i = 0; i < max77693_pmic->num_regulators; i++) {
 		int id = rdata[i].id;
 
+		if (!rdata[i].initdata)
+			continue;
+
 		config.init_data = rdata[i].initdata;
 		config.of_node = rdata[i].of_node;
 
Signature · 1 line
1.8.1.2
maintainer
#1 lore raw
Quoted 5 lines · Axel Lin

The code in max77693_pmic_dt_parse_rdata() does skip setting rdata if !rmatch[i].init_data. So we may have some empty entries in rdata[]. We need to skip register regulator if no platform initialization data, otherwise we may resiter regulator with invalid settings ( the empty entries of rdata[]).

It should be legal to have no init data, this should make the regulator available read only (allowing the current settings to be read back but nothing else).