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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Apr 2014 16:55:40 +0100
From:	Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To:	broonie@...nel.org
Cc:	lgirdwood@...il.com, linux-kernel@...r.kernel.org,
	patches@...nsource.wolfsonmicro.com,
	Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Subject: [PATCH 1/2] regulator: arizona-micsupp: Fix build errors with CONFIG_OF not defined

Some of the OF handling functions do not have empty alternatives defined
if CONFIG_OF is not defined. This patch ifdefs out the offending code.

Reported-by: Randy Dunlap <rdunlap@...radead.org>
Signed-off-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
---
 drivers/regulator/arizona-micsupp.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c
index b80ebbe..19d0b2c 100644
--- a/drivers/regulator/arizona-micsupp.c
+++ b/drivers/regulator/arizona-micsupp.c
@@ -196,6 +196,7 @@ static const struct regulator_init_data arizona_micsupp_ext_default = {
 	.num_consumer_supplies = 1,
 };
 
+#if IS_ENABLED(CONFIG_OF)
 static int arizona_micsupp_of_get_pdata(struct arizona *arizona,
 					struct regulator_config *config)
 {
@@ -222,6 +223,22 @@ static int arizona_micsupp_of_get_pdata(struct arizona *arizona,
 	return 0;
 }
 
+static void arizona_micsupp_of_put_pdata(struct regulator_config *config)
+{
+	of_node_put(config->of_node);
+}
+#else
+static int arizona_micsupp_of_get_pdata(struct arizona *arizona,
+					struct regulator_config *config)
+{
+	return 0;
+}
+
+static void arizona_micsupp_of_put_pdata(struct regulator_config *config)
+{
+}
+#endif
+
 static int arizona_micsupp_probe(struct platform_device *pdev)
 {
 	struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
@@ -288,7 +305,8 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	of_node_put(config.of_node);
+	if (IS_ENABLED(CONFIG_OF))
+		arizona_micsupp_of_put_pdata(&config);
 
 	platform_set_drvdata(pdev, micsupp);
 
-- 
1.7.9.5

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ