linux-kernel.vger.kernel.org archive mirror
 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 related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: gpio-regulator: warn if unknown regulator type
  2014-01-26 13:28 [PATCH] regulator: gpio-regulator: warn if unknown regulator type Ben Dooks
@ 2014-01-26 14:39 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-01-26 14:39 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel, Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

On Sun, Jan 26, 2014 at 01:28:59PM +0000, Ben Dooks wrote:
> 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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ 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;
as well as URLs for NNTP newsgroup(s).