diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-02-28 02:23:43 -0500 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-04-20 11:17:17 -0400 |
commit | 8cf93b9ceaf4534cdeda5727782001f8fecb1688 (patch) | |
tree | 22b7df101d3ad8c8243c604cc73a6af09cea08c9 /arch/arm/mach-at91/at91sam9g45_devices.c | |
parent | 4e114c9576b53461b14ac30f5e6159e73aa6abd3 (diff) |
ARM: at91: standard device init only if DT is not populated.
This will avoid the CONFIG_OF on the *_devices.c as this file is deprecated
for DT support.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index db2f88c246ff..35bd42d02195 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -69,15 +69,7 @@ static struct platform_device at_hdmac_device = { | |||
69 | 69 | ||
70 | void __init at91_add_device_hdmac(void) | 70 | void __init at91_add_device_hdmac(void) |
71 | { | 71 | { |
72 | #if defined(CONFIG_OF) | 72 | platform_device_register(&at_hdmac_device); |
73 | struct device_node *of_node = | ||
74 | of_find_node_by_name(NULL, "dma-controller"); | ||
75 | |||
76 | if (of_node) | ||
77 | of_node_put(of_node); | ||
78 | else | ||
79 | #endif | ||
80 | platform_device_register(&at_hdmac_device); | ||
81 | } | 73 | } |
82 | #else | 74 | #else |
83 | void __init at91_add_device_hdmac(void) {} | 75 | void __init at91_add_device_hdmac(void) {} |
@@ -1094,25 +1086,8 @@ static struct platform_device at91sam9g45_tcb1_device = { | |||
1094 | .num_resources = ARRAY_SIZE(tcb1_resources), | 1086 | .num_resources = ARRAY_SIZE(tcb1_resources), |
1095 | }; | 1087 | }; |
1096 | 1088 | ||
1097 | #if defined(CONFIG_OF) | ||
1098 | static struct of_device_id tcb_ids[] = { | ||
1099 | { .compatible = "atmel,at91rm9200-tcb" }, | ||
1100 | { /*sentinel*/ } | ||
1101 | }; | ||
1102 | #endif | ||
1103 | |||
1104 | static void __init at91_add_device_tc(void) | 1089 | static void __init at91_add_device_tc(void) |
1105 | { | 1090 | { |
1106 | #if defined(CONFIG_OF) | ||
1107 | struct device_node *np; | ||
1108 | |||
1109 | np = of_find_matching_node(NULL, tcb_ids); | ||
1110 | if (np) { | ||
1111 | of_node_put(np); | ||
1112 | return; | ||
1113 | } | ||
1114 | #endif | ||
1115 | |||
1116 | platform_device_register(&at91sam9g45_tcb0_device); | 1091 | platform_device_register(&at91sam9g45_tcb0_device); |
1117 | platform_device_register(&at91sam9g45_tcb1_device); | 1092 | platform_device_register(&at91sam9g45_tcb1_device); |
1118 | } | 1093 | } |
@@ -1763,6 +1738,9 @@ void __init at91_add_device_serial(void) {} | |||
1763 | */ | 1738 | */ |
1764 | static int __init at91_add_standard_devices(void) | 1739 | static int __init at91_add_standard_devices(void) |
1765 | { | 1740 | { |
1741 | if (of_have_populated_dt()) | ||
1742 | return 0; | ||
1743 | |||
1766 | at91_add_device_hdmac(); | 1744 | at91_add_device_hdmac(); |
1767 | at91_add_device_rtc(); | 1745 | at91_add_device_rtc(); |
1768 | at91_add_device_rtt(); | 1746 | at91_add_device_rtt(); |