Skip to contentSkip to conversation

regulator: gpio-regulator: warn if unknown regulator type

PATCH In review Ben Dooks 2 participants 2 messages Jan 26, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 regulator: gpio-regulator: warn if unknown regulator type

The of_get_gpio_regulator_config() will error out if there is no "regulator_type" field in the fdt node hoewver it makes no attempt at warning if the contents of said node is not known.

---
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: [email protected]

---
 drivers/regulator/gpio-regulator.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/regulator/gpio-regulator.c +2 -0
index 234960d..e32240a 100644
@@ -213,6 +213,8 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
 		config->type = REGULATOR_VOLTAGE;
 	else if (!strncmp("current", regtype, 7))
 		config->type = REGULATOR_CURRENT;
+	else
+		dev_warn(dev, "Unknown regulator-type '%s'\n", regtype);
 
 	return config;
 }
Signature · 1 line
1.8.5.2
maintainer
#1 lore raw
Quoted 3 lines · Ben Dooks

The of_get_gpio_regulator_config() will error out if there is no "regulator_type" field in the fdt node hoewver it makes no attempt at warning if the contents of said node is not known.

Please sumbit patches against current code, this won't apply since this code has been restructured since the version you're working with and now has an improved version of this warning.