mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: gpio-regulator: warn if unknown regulator type
@ 2014-01-26 13:28 Ben Dooks
  2014-01-26 14:39 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2014-01-26 13:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ben Dooks, Liam Girdwood, Mark Brown, linux-kernel

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@codethink.co.uk>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
---
 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


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

end of thread, other threads:[~2014-01-26 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-26 13:28 [PATCH] regulator: gpio-regulator: warn if unknown regulator type Ben Dooks
2014-01-26 14:39 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®