diff mbox

[v4,4/4] dt: add amba device creation to platform bus scan

Message ID 1307738923-7564-5-git-send-email-robherring2@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rob Herring June 10, 2011, 8:48 p.m. UTC
From: Rob Herring <rob.herring@calxeda.com>

Add support to the platform bus scanning to call custom device creation
function for amba devices.

Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: arnd@arndb.de
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 drivers/of/platform.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 8d0f477..1712f22 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -21,6 +21,7 @@ 
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/amba/bus.h>
 
 static int of_dev_node_match(struct device *dev, void *data)
 {
@@ -234,6 +235,11 @@  static int of_platform_bus_create(struct device_node *bus,
 		return 0;
 	}
 
+	if (of_device_is_compatible(bus, "arm,amba-device")) {
+		of_amba_device_create(bus, parent);
+		return 0;
+	}
+	
 	dev = of_platform_device_create(bus, NULL, parent);
 	if (!dev || !of_match_node(matches, bus))
 		return 0;