[PATCH 07/26] OF platform: export of_amba_device_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




This is needed because the pci-amba bus will create one or more amba devices
for each probed pci device. We cannot create all the devices belonging to
the same amba bus with just one call to of_platform_populate()

Signed-off-by: Davide Ciminaghi <ciminaghi@xxxxxxxxx>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@xxxxxx>
---
 drivers/of/platform.c       |   17 +++++++++--------
 include/linux/of_platform.h |    6 +++++-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b0d1ff8..57c6bbe 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -249,10 +249,10 @@ struct platform_device *of_platform_device_create(struct device_node *np,
 EXPORT_SYMBOL(of_platform_device_create);
 
 #ifdef CONFIG_ARM_AMBA
-static struct amba_device *of_amba_device_create(struct device_node *node,
-						 const char *bus_id,
-						 void *platform_data,
-						 struct device *parent)
+struct amba_device *of_amba_device_create(struct device_node *node,
+					  const char *bus_id,
+					  void *platform_data,
+					  struct device *parent)
 {
 	struct amba_device *dev;
 	const void *prop;
@@ -304,14 +304,15 @@ err_free:
 	return NULL;
 }
 #else /* CONFIG_ARM_AMBA */
-static struct amba_device *of_amba_device_create(struct device_node *node,
-						 const char *bus_id,
-						 void *platform_data,
-						 struct device *parent)
+struct amba_device *of_amba_device_create(struct device_node *node,
+					  const char *bus_id,
+					  void *platform_data,
+					  struct device *parent)
 {
 	return NULL;
 }
 #endif /* CONFIG_ARM_AMBA */
+EXPORT_SYMBOL(of_amba_device_create);
 
 /**
  * of_devname_lookup() - Given a device node, lookup the preferred Linux name
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 05cb4a9..6cd5ac2 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -59,10 +59,14 @@ extern struct platform_device *of_device_alloc(struct device_node *np,
 					 struct device *parent);
 extern struct platform_device *of_find_device_by_node(struct device_node *np);
 
-/* Platform devices and busses creation */
+/* Platform and amba devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
 						   struct device *parent);
+extern struct amba_device *of_amba_device_create(struct device_node *node,
+						 const char *bus_id,
+						 void *platform_data,
+						 struct device *parent);
 
 extern int of_platform_bus_probe(struct device_node *root,
 				 const struct of_device_id *matches,
-- 
1.7.7.2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux