diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2011-10-10 10:50:43 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-02-03 07:45:17 -0500 |
commit | 2756bf5c03bd6fec9462c0742dddb771838bf080 (patch) | |
tree | b970a2e394b637402425f7f16e20fda7854a9b7e /arch/arm/mach-at91/at91sam9g45_devices.c | |
parent | bdad0b9a1c7222a771d25e2a20e81f5563968002 (diff) |
ARM: at91/dma: DMA controller registering with DT support
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>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 07708d422681..96e2adcd5a84 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -64,7 +64,15 @@ static struct platform_device at_hdmac_device = { | |||
64 | 64 | ||
65 | void __init at91_add_device_hdmac(void) | 65 | void __init at91_add_device_hdmac(void) |
66 | { | 66 | { |
67 | platform_device_register(&at_hdmac_device); | 67 | #if defined(CONFIG_OF) |
68 | struct device_node *of_node = | ||
69 | of_find_node_by_name(NULL, "dma-controller"); | ||
70 | |||
71 | if (of_node) | ||
72 | of_node_put(of_node); | ||
73 | else | ||
74 | #endif | ||
75 | platform_device_register(&at_hdmac_device); | ||
68 | } | 76 | } |
69 | #else | 77 | #else |
70 | void __init at91_add_device_hdmac(void) {} | 78 | void __init at91_add_device_hdmac(void) {} |