Skip to content

Commit

Permalink
ARM: at91/dma: DMA controller registering with DT support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Ferre committed Feb 29, 2012
1 parent b9eaa81 commit 851c52b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion arch/arm/mach-at91/at91sam9g45_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit 851c52b

Please sign in to comment.