]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: at91/dma: DMA controller registering with DT support
authorNicolas Ferre <nicolas.ferre@atmel.com>
Mon, 10 Oct 2011 14:50:43 +0000 (16:50 +0200)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Wed, 29 Feb 2012 17:20:39 +0000 (18:20 +0100)
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 <nicolas.ferre@atmel.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
arch/arm/mach-at91/at91sam9g45_devices.c

index 07708d4226811236c0c1fd8773f4be50f4ba4a2f..96e2adcd5a841907be15beda7bdbb67dd87b5259 100644 (file)
@@ -64,7 +64,15 @@ static struct platform_device at_hdmac_device = {
 
 void __init at91_add_device_hdmac(void)
 {
-       platform_device_register(&at_hdmac_device);
+#if defined(CONFIG_OF)
+       struct device_node *of_node =
+               of_find_node_by_name(NULL, "dma-controller");
+
+       if (of_node)
+               of_node_put(of_node);
+       else
+#endif
+               platform_device_register(&at_hdmac_device);
 }
 #else
 void __init at91_add_device_hdmac(void) {}