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 | |
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')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 30 |
2 files changed, 7 insertions, 43 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index ad00fe91d37d..d556de141114 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -702,25 +702,8 @@ static struct platform_device at91sam9260_tcb1_device = { | |||
702 | .num_resources = ARRAY_SIZE(tcb1_resources), | 702 | .num_resources = ARRAY_SIZE(tcb1_resources), |
703 | }; | 703 | }; |
704 | 704 | ||
705 | #if defined(CONFIG_OF) | ||
706 | static struct of_device_id tcb_ids[] = { | ||
707 | { .compatible = "atmel,at91rm9200-tcb" }, | ||
708 | { /*sentinel*/ } | ||
709 | }; | ||
710 | #endif | ||
711 | |||
712 | static void __init at91_add_device_tc(void) | 705 | static void __init at91_add_device_tc(void) |
713 | { | 706 | { |
714 | #if defined(CONFIG_OF) | ||
715 | struct device_node *np; | ||
716 | |||
717 | np = of_find_matching_node(NULL, tcb_ids); | ||
718 | if (np) { | ||
719 | of_node_put(np); | ||
720 | return; | ||
721 | } | ||
722 | #endif | ||
723 | |||
724 | platform_device_register(&at91sam9260_tcb0_device); | 707 | platform_device_register(&at91sam9260_tcb0_device); |
725 | platform_device_register(&at91sam9260_tcb1_device); | 708 | platform_device_register(&at91sam9260_tcb1_device); |
726 | } | 709 | } |
@@ -1364,6 +1347,9 @@ void __init at91_add_device_cf(struct at91_cf_data * data) {} | |||
1364 | */ | 1347 | */ |
1365 | static int __init at91_add_standard_devices(void) | 1348 | static int __init at91_add_standard_devices(void) |
1366 | { | 1349 | { |
1350 | if (of_have_populated_dt()) | ||
1351 | return 0; | ||
1352 | |||
1367 | at91_add_device_rtt(); | 1353 | at91_add_device_rtt(); |
1368 | at91_add_device_watchdog(); | 1354 | at91_add_device_watchdog(); |
1369 | at91_add_device_tc(); | 1355 | at91_add_device_tc(); |
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(); |