ARM: imx: rework mx27_pm_init() call
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Jun 2016 02:22:16 +0000 (10:22 +0800)
committerShawn Guo <shawnguo@kernel.org>
Tue, 28 Jun 2016 02:26:40 +0000 (10:26 +0800)
mx27_pm_init() uses its own initcall, unlike all of the other
functions like it. Replacing the initcall with a .init_late()
callback makes imx27 more like the others and lets us remove
the last caller of cpu_is_mx27().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/common.h
arch/arm/mach-imx/imx27-dt.c
arch/arm/mach-imx/mm-imx27.c
arch/arm/mach-imx/pm-imx27.c

index 0a1d1f175b7a15bfa90dcb7ab7093862fd8d0687..a8f4693330276a6f8a00fe20b0d16b5ec4d9f9a2 100644 (file)
@@ -67,6 +67,7 @@ void imx_gpc_set_arm_power_in_lpm(bool power_off);
 void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
 void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
 void imx25_pm_init(void);
+void imx27_pm_init(void);
 
 enum mxc_cpu_pwr_mode {
        WAIT_CLOCKED,           /* wfi only */
index 530a728c2acc2d9e5d5e7398109de02fc58805ca..a754b8a48f3828f17e63159792a01b0511160857 100644 (file)
@@ -27,5 +27,6 @@ DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
        .map_io         = mx27_map_io,
        .init_early     = imx27_init_early,
        .init_irq       = mx27_init_irq,
+       .init_late      = imx27_pm_init,
        .dt_compat      = imx27_dt_board_compat,
 MACHINE_END
index 7d82a5a5b16b5c73d8938b1b3b325d3d0cb1d6f9..862b9b7762c786918481799fe92c4b91c2e2851f 100644 (file)
@@ -98,4 +98,6 @@ void __init imx27_soc_init(void)
        /* imx27 has the imx21 type audmux */
        platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
                                        ARRAY_SIZE(imx27_audmux_res));
+
+       imx27_pm_init();
 }
index 43096c8990d4cb913935b62c758107316e46a637..d943535566c84146b7877a790bb2718cf8672d45 100644 (file)
@@ -37,13 +37,7 @@ static const struct platform_suspend_ops mx27_suspend_ops = {
        .valid = suspend_valid_only_mem,
 };
 
-static int __init mx27_pm_init(void)
+void __init imx27_pm_init(void)
 {
-       if (!cpu_is_mx27())
-               return 0;
-
        suspend_set_ops(&mx27_suspend_ops);
-       return 0;
 }
-
-device_initcall(mx27_pm_init);