linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V6 02/13] of: platform: Make of_platform_bus_create() global
Date: Fri, 15 Dec 2017 09:28:09 +0530	[thread overview]
Message-ID: <83a2f2479ecc6c44a1bfdd89f55f315da7bafc7c.1513309217.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <3875af7e7e77745f02ad429f09a1ad168a55e248.1513264961.git.viresh.kumar@linaro.org>

The boot constraints core needs to create platform or AMBA devices
corresponding to a compatible string and not for rest of the nodes in
DT. of_platform_bus_create() fits in the best to achieve that.

Allow it to be used outside of platform.c.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V6:
- Build bot reported a compilation error when CONFIG_OF_ADDRESS isn't
  selected in .config.
- Git didn't catch the change in the file when I rebased the patches to
  the latest kernel and applied this patch cleanly and so I missed that
  the function declaration is placed outside of the #ifdef/endif block.
- This patch just moves the declaration within the CONFIG_OF_ADDRESS
  block.

 drivers/of/platform.c       |  8 ++++----
 include/linux/of_platform.h | 11 +++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 61a4a81bea9f..6f707bfb348f 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -397,10 +397,10 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
  * Creates a platform_device for the provided device_node, and optionally
  * recursively create devices for all the child nodes.
  */
-static int of_platform_bus_create(struct device_node *bus,
-				  const struct of_device_id *matches,
-				  const struct of_dev_auxdata *lookup,
-				  struct device *parent, bool strict)
+int of_platform_bus_create(struct device_node *bus,
+			   const struct of_device_id *matches,
+			   const struct of_dev_auxdata *lookup,
+			   struct device *parent, bool strict)
 {
 	const struct of_dev_auxdata *auxdata;
 	struct device_node *child;
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 4909d1aa47ec..ff80fba79c41 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -81,6 +81,10 @@ extern int of_platform_bus_probe(struct device_node *root,
 				 const struct of_device_id *matches,
 				 struct device *parent);
 #ifdef CONFIG_OF_ADDRESS
+extern int of_platform_bus_create(struct device_node *bus,
+				  const struct of_device_id *matches,
+				  const struct of_dev_auxdata *lookup,
+				  struct device *parent, bool strict);
 extern int of_platform_populate(struct device_node *root,
 				const struct of_device_id *matches,
 				const struct of_dev_auxdata *lookup,
@@ -94,6 +98,13 @@ extern int devm_of_platform_populate(struct device *dev);
 
 extern void devm_of_platform_depopulate(struct device *dev);
 #else
+static inline int of_platform_bus_create(struct device_node *bus,
+					 const struct of_device_id *matches,
+					 const struct of_dev_auxdata *lookup,
+					 struct device *parent, bool strict)
+{
+	return -ENODEV;
+}
 static inline int of_platform_populate(struct device_node *root,
 					const struct of_device_id *matches,
 					const struct of_dev_auxdata *lookup,
-- 
2.15.0.194.g9af6a3dea062

  reply	other threads:[~2017-12-15  3:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 15:33 [PATCH V5 00/13] drivers: Boot Constraint core Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 01/13] of: platform: Add of_find_any_device_by_node() Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 02/13] of: platform: Make of_platform_bus_create() global Viresh Kumar
2017-12-15  3:58   ` Viresh Kumar [this message]
2017-12-14 15:33 ` [PATCH V5 03/13] drivers: Add boot constraints core Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 04/13] boot_constraint: Add support for supply constraints Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 05/13] boot_constraint: Add support for clk constraints Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 06/13] boot_constraint: Add support for PM constraints Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 07/13] boot_constraint: Add debugfs support Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 08/13] boot_constraint: Manage deferrable constraints Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 09/13] boot_constraint: Add support for Hisilicon platforms Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 10/13] boot_constraint: Add support for IMX platform Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 11/13] boot_constraint: Add Qualcomm display controller constraints Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 12/13] boot_constraint: Update MAINTAINERS Viresh Kumar
2017-12-14 15:33 ` [PATCH V5 13/13] boot_constraint: Add documentation Viresh Kumar
2018-01-09 18:47 ` [PATCH V5 00/13] drivers: Boot Constraint core Greg Kroah-Hartman
2018-01-10  3:44   ` Viresh Kumar
2018-01-10  8:08     ` Greg Kroah-Hartman
2018-01-10  8:42       ` Viresh Kumar
2018-01-10 18:19         ` Rob Herring
2018-01-10 18:54 ` Olof Johansson
2018-01-11  9:51   ` Viresh Kumar
  -- strict thread matches above, loose matches on Subject: below --
2018-01-10  3:47 [PATCH V6 Resend " Viresh Kumar
2018-01-10  3:47 ` [PATCH V6 02/13] of: platform: Make of_platform_bus_create() global Viresh Kumar

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=83a2f2479ecc6c44a1bfdd89f55f315da7bafc7c.1513309217.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).