Thread (14 messages) 14 messages, 4 authors, 2011-10-12
STALE5347d

[PATCH 4/4] ARM: at91/dma: DMA controller registering with DT support

From: Nicolas Ferre <hidden>
Date: 2011-10-10 16:38:10
Also in: linux-devicetree, lkml
Subsystem: arm port, arm/microchip (at91) soc support, the rest · Maintainers: Russell King, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Linus Torvalds

Device tree support on at91sam9g45 family SoC. Only call
platform_device_register() if no dma-controller node is
found in device tree.

Signed-off-by: Nicolas Ferre <redacted>
---
 arch/arm/mach-at91/at91sam9g45_devices.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index c9b897f..cee7287 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -64,7 +64,14 @@ static struct platform_device at_hdmac_device = {
 
 void __init at91_add_device_hdmac(void)
 {
-	platform_device_register(&at_hdmac_device);
+	struct device_node *of_node =
+		of_find_node_by_name(NULL, "dma-controller");
+
+	if (of_node) {
+		of_node_put(of_node);
+	} else {
+		platform_device_register(&at_hdmac_device);
+	}
 }
 #else
 void __init at91_add_device_hdmac(void) {}
-- 
1.7.5.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help