All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: don't try to use DT information without CONFIG_OF
@ 2018-03-06 12:33 Arnd Bergmann
  2018-03-07 14:15 ` Applied "regulator: don't try to use DT information without CONFIG_OF" to the regulator tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-03-06 12:33 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Arnd Bergmann, Maciej Purski, Chunyan Zhang, Tirupathi Reddy,
	linux-kernel

The coupled regulator support requires CONFIG_OF today, otherwise
we get a link error:

drivers/regulator/core.o: In function `regulator_fill_coupling_array':
core.c:(.text+0x3e44): undefined reference to `of_parse_coupled_regulator'
drivers/regulator/core.o: In function `regulator_register':
core.c:(.text+0x5eb4): undefined reference to `of_get_n_coupled'
core.c:(.text+0x5f08): undefined reference to `of_check_coupling_data'

This changes the affected functions to return success when CONFIG_OF
is disabled, which should result in the same behavior as before.

Fixes: cf6fc8064766 ("regulator: core: Resolve coupled regulators")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/regulator/core.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dedf737a2bad..dbc3381105fb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4351,6 +4351,9 @@ static int regulator_register_fill_coupling_array(struct device *dev,
 {
 	struct regulator_dev *rdev = dev_to_rdev(dev);
 
+	if (!IS_ENABLED(CONFIG_OF))
+		return 0;
+
 	if (regulator_fill_coupling_array(rdev))
 		rdev_dbg(rdev, "unable to resolve coupling\n");
 
@@ -4359,7 +4362,12 @@ static int regulator_register_fill_coupling_array(struct device *dev,
 
 static int regulator_resolve_coupling(struct regulator_dev *rdev)
 {
-	int n_phandles = of_get_n_coupled(rdev);
+	int n_phandles;
+
+	if (!IS_ENABLED(CONFIG_OF))
+		return 0;
+
+	n_phandles = of_get_n_coupled(rdev);
 
 	if (n_phandles + 1 > MAX_COUPLED) {
 		rdev_err(rdev, "too many regulators coupled\n");
-- 
2.9.0

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

* Applied "regulator: don't try to use DT information without CONFIG_OF" to the regulator tree
  2018-03-06 12:33 [PATCH] regulator: don't try to use DT information without CONFIG_OF Arnd Bergmann
@ 2018-03-07 14:15 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2018-03-07 14:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Liam Girdwood, Mark Brown, Maciej Purski,
	Chunyan Zhang, Tirupathi Reddy, linux-kernel, linux-kernel

The patch

   regulator: don't try to use DT information without CONFIG_OF

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 30f00f4897a093bb2b0308caab7855d6b75e9e1b Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 6 Mar 2018 13:33:09 +0100
Subject: [PATCH] regulator: don't try to use DT information without CONFIG_OF

The coupled regulator support requires CONFIG_OF today, otherwise
we get a link error:

drivers/regulator/core.o: In function `regulator_fill_coupling_array':
core.c:(.text+0x3e44): undefined reference to `of_parse_coupled_regulator'
drivers/regulator/core.o: In function `regulator_register':
core.c:(.text+0x5eb4): undefined reference to `of_get_n_coupled'
core.c:(.text+0x5f08): undefined reference to `of_check_coupling_data'

This changes the affected functions to return success when CONFIG_OF
is disabled, which should result in the same behavior as before.

Fixes: cf6fc8064766 ("regulator: core: Resolve coupled regulators")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/core.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d68244ad9423..e685f8b94acf 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4345,6 +4345,9 @@ static int regulator_register_fill_coupling_array(struct device *dev,
 {
 	struct regulator_dev *rdev = dev_to_rdev(dev);
 
+	if (!IS_ENABLED(CONFIG_OF))
+		return 0;
+
 	if (regulator_fill_coupling_array(rdev))
 		rdev_dbg(rdev, "unable to resolve coupling\n");
 
@@ -4353,7 +4356,12 @@ static int regulator_register_fill_coupling_array(struct device *dev,
 
 static int regulator_resolve_coupling(struct regulator_dev *rdev)
 {
-	int n_phandles = of_get_n_coupled(rdev);
+	int n_phandles;
+
+	if (!IS_ENABLED(CONFIG_OF))
+		return 0;
+
+	n_phandles = of_get_n_coupled(rdev);
 
 	if (n_phandles + 1 > MAX_COUPLED) {
 		rdev_err(rdev, "too many regulators coupled\n");
-- 
2.16.2

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

end of thread, other threads:[~2018-03-07 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06 12:33 [PATCH] regulator: don't try to use DT information without CONFIG_OF Arnd Bergmann
2018-03-07 14:15 ` Applied "regulator: don't try to use DT information without CONFIG_OF" to the regulator tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.