aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2013-08-11 08:38:59 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2013-09-27 12:34:25 -0400
commit53ea68873a68665c33ddd7332cf4cf39315f9cbc (patch)
tree4c2ecb6b483d9e856de69d0fe1ed43f326f4df18
parent91a319779cb3a871d48e39cccf6cc72348eb1512 (diff)
ARM: sunxi: Simplify restart setup code
Now that we have different machine definitions for different SoCs, we can remove the DT lookup to get the restart hook we should be using, and hardcode it in the machine definition instead. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
-rw-r--r--arch/arm/mach-sunxi/sunxi.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index e0641dd7aebb..f184f6c2fa33 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -93,14 +93,13 @@ static void sun6i_restart(enum reboot_mode mode, const char *cmd)
93} 93}
94 94
95static struct of_device_id sunxi_restart_ids[] = { 95static struct of_device_id sunxi_restart_ids[] = {
96 { .compatible = "allwinner,sun4i-wdt", .data = sun4i_restart }, 96 { .compatible = "allwinner,sun4i-wdt" },
97 { .compatible = "allwinner,sun6i-wdt", .data = sun6i_restart }, 97 { .compatible = "allwinner,sun6i-wdt" },
98 { /*sentinel*/ } 98 { /*sentinel*/ }
99}; 99};
100 100
101static void sunxi_setup_restart(void) 101static void sunxi_setup_restart(void)
102{ 102{
103 const struct of_device_id *of_id;
104 struct device_node *np; 103 struct device_node *np;
105 104
106 np = of_find_matching_node(NULL, sunxi_restart_ids); 105 np = of_find_matching_node(NULL, sunxi_restart_ids);
@@ -109,11 +108,6 @@ static void sunxi_setup_restart(void)
109 108
110 wdt_base = of_iomap(np, 0); 109 wdt_base = of_iomap(np, 0);
111 WARN(!wdt_base, "failed to map watchdog base address"); 110 WARN(!wdt_base, "failed to map watchdog base address");
112
113 of_id = of_match_node(sunxi_restart_ids, np);
114 WARN(!of_id, "restart function not available");
115
116 arm_pm_restart = of_id->data;
117} 111}
118 112
119static void __init sunxi_timer_init(void) 113static void __init sunxi_timer_init(void)
@@ -140,6 +134,7 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
140 .init_machine = sunxi_dt_init, 134 .init_machine = sunxi_dt_init,
141 .init_time = sunxi_timer_init, 135 .init_time = sunxi_timer_init,
142 .dt_compat = sunxi_board_dt_compat, 136 .dt_compat = sunxi_board_dt_compat,
137 .restart = sun4i_restart,
143MACHINE_END 138MACHINE_END
144 139
145static const char * const sun6i_board_dt_compat[] = { 140static const char * const sun6i_board_dt_compat[] = {
@@ -151,6 +146,7 @@ DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
151 .init_machine = sunxi_dt_init, 146 .init_machine = sunxi_dt_init,
152 .init_time = sunxi_timer_init, 147 .init_time = sunxi_timer_init,
153 .dt_compat = sun6i_board_dt_compat, 148 .dt_compat = sun6i_board_dt_compat,
149 .restart = sun6i_restart,
154MACHINE_END 150MACHINE_END
155 151
156static const char * const sun7i_board_dt_compat[] = { 152static const char * const sun7i_board_dt_compat[] = {
@@ -162,4 +158,5 @@ DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
162 .init_machine = sunxi_dt_init, 158 .init_machine = sunxi_dt_init,
163 .init_time = sunxi_timer_init, 159 .init_time = sunxi_timer_init,
164 .dt_compat = sun7i_board_dt_compat, 160 .dt_compat = sun7i_board_dt_compat,
161 .restart = sun4i_restart,
165MACHINE_END 162MACHINE_END