[PATCH] regulator: gpio-regulator: warn if unknown regulator type

From: Ben Dooks
Date: Sun Jan 26 2014 - 08:29:42 EST


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.

Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>
---
Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/regulator/gpio-regulator.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 234960d..e32240a 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -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;
}
--
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/