From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH 1/2] regulator: arizona-micsupp: Fix build errors with CONFIG_OF not defined
Date: Fri, 25 Apr 2014 16:55:40 +0100 [thread overview]
Message-ID: <1398441341-19436-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
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@infradead.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.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
next reply other threads:[~2014-04-25 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-25 15:55 Charles Keepax [this message]
2014-04-25 15:55 ` [PATCH 2/2] regulator: arizona-ldo1: Fix build errors for when CONFIG_OF not defined Charles Keepax
2014-04-25 16:11 ` [PATCH 1/2] regulator: arizona-micsupp: Fix build errors with " Mark Brown
2014-04-25 20:30 ` Charles Keepax
2014-04-26 16:59 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398441341-19436-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox