lkml.org 
[lkml]   [2017]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V4 02/12] of: platform: Make of_platform_bus_create() global
Date
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
\
 
 \ /
  Last update: 2017-10-29 14:49    [W:0.251 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site