lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 26 Jan 2014 13:28:59 +0000
From:	Ben Dooks <ben.dooks@...ethink.co.uk>
To:	linux-kernel@...ts.codethink.co.uk
Cc:	Ben Dooks <ben.dooks@...ethink.co.uk>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] 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.

Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
---
Cc: Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.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

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

Powered by blists - more mailing lists