From: Viresh Kumar <viresh.kumar@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Rajendra Nayak <rnayak@codeaurora.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, robdclark@gmail.com,
s.hauer@pengutronix.de, l.stach@pengutronix.de,
shawnguo@kernel.org, fabio.estevam@nxp.com, nm@ti.com,
xuwei5@hisilicon.com, robh+dt@kernel.org,
Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org
Subject: [PATCH V4 02/12] of: platform: Make of_platform_bus_create() global
Date: Sun, 29 Oct 2017 19:18:50 +0530 [thread overview]
Message-ID: <0244d3887d8439bb2c65c14fbc37074543b9789d.1509284255.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1509284255.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1509284255.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.
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/of/platform.c | 8 ++++----
include/linux/of_platform.h | 12 ++++++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b38a8e5908a3..808628842ea8 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -362,10 +362,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 fbf8a6443885..3ee106018b60 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -82,6 +82,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
struct device *parent);
extern int of_platform_device_destroy(struct device *dev, void *data);
+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_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent);
@@ -118,6 +122,14 @@ static inline int of_platform_device_destroy(struct device *dev, void *data)
return -ENODEV;
}
+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_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent)
--
2.15.0.rc1.236.g92ea95045093
next prev parent reply other threads:[~2017-10-29 13:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-29 13:48 [PATCH V4 00/12] drivers: Boot Constraints core Viresh Kumar
2017-10-29 13:48 ` [PATCH V4 01/12] of: platform: Add of_find_amba_device_by_node() Viresh Kumar
2017-10-29 13:48 ` Viresh Kumar [this message]
2017-10-30 22:07 ` [PATCH V4 00/12] drivers: Boot Constraints core Rob Herring
2017-10-31 10:01 ` Viresh Kumar
2017-10-31 16:03 ` Rob Herring
[not found] ` <cover.1509284255.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-11-28 4:18 ` Viresh Kumar
2017-12-13 9:55 ` Greg Kroah-Hartman
[not found] ` <20171213095529.GK13194-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-12-13 10:27 ` 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=0244d3887d8439bb2c65c14fbc37074543b9789d.1509284255.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=rnayak@codeaurora.org \
--cc=robdclark@gmail.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@codeaurora.org \
--cc=shawnguo@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=xuwei5@hisilicon.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;
as well as URLs for NNTP newsgroup(s).