@@ -138,4 +138,8 @@ static inline int omap4_twl_init(void)
}
#endif
+#ifndef CONFIG_SUSPEND
+#define omap_pm_ops NULL
+#endif
+
#endif
@@ -350,14 +350,14 @@ static void omap2_pm_end(void)
enable_hlt();
}
-static struct platform_suspend_ops omap_pm_ops = {
- .begin = omap2_pm_begin,
- .enter = omap2_pm_enter,
- .end = omap2_pm_end,
- .valid = suspend_valid_only_mem,
+static const struct platform_suspend_ops omap_pm_ops[] = {
+ {
+ .begin = omap2_pm_begin,
+ .enter = omap2_pm_enter,
+ .end = omap2_pm_end,
+ .valid = suspend_valid_only_mem,
+ }
};
-#else
-static const struct platform_suspend_ops __initdata omap_pm_ops;
#endif /* CONFIG_SUSPEND */
/* XXX This function should be shareable between OMAP2xxx and OMAP3 */
@@ -582,7 +582,7 @@ static int __init omap2_pm_init(void)
omap24xx_cpu_suspend_sz);
}
- suspend_set_ops(&omap_pm_ops);
+ suspend_set_ops(omap_pm_ops);
pm_idle = omap2_pm_idle;
return 0;
@@ -605,11 +605,13 @@ static void omap3_pm_end(void)
return;
}
-static struct platform_suspend_ops omap_pm_ops = {
- .begin = omap3_pm_begin,
- .end = omap3_pm_end,
- .enter = omap3_pm_enter,
- .valid = suspend_valid_only_mem,
+static const struct platform_suspend_ops omap_pm_ops[] = {
+ {
+ .begin = omap3_pm_begin,
+ .end = omap3_pm_end,
+ .enter = omap3_pm_enter,
+ .valid = suspend_valid_only_mem,
+ }
};
#endif /* CONFIG_SUSPEND */
@@ -1067,9 +1069,7 @@ static int __init omap3_pm_init(void)
core_clkdm = clkdm_lookup("core_clkdm");
omap_push_sram_idle();
-#ifdef CONFIG_SUSPEND
- suspend_set_ops(&omap_pm_ops);
-#endif /* CONFIG_SUSPEND */
+ suspend_set_ops(omap_pm_ops);
pm_idle = omap3_pm_idle;
omap3_idle_init();
@@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/slab.h>
+#include "pm.h"
#include "powerdomain.h"
#include <mach/omap4-common.h>
@@ -65,11 +66,13 @@ static void omap4_pm_end(void)
return;
}
-static struct platform_suspend_ops omap_pm_ops = {
- .begin = omap4_pm_begin,
- .end = omap4_pm_end,
- .enter = omap4_pm_enter,
- .valid = suspend_valid_only_mem,
+static const struct platform_suspend_ops omap_pm_ops[] = {
+ {
+ .begin = omap4_pm_begin,
+ .end = omap4_pm_end,
+ .enter = omap4_pm_enter,
+ .valid = suspend_valid_only_mem,
+ }
};
#endif /* CONFIG_SUSPEND */
@@ -113,9 +116,7 @@ static int __init omap4_pm_init(void)
}
#endif
-#ifdef CONFIG_SUSPEND
- suspend_set_ops(&omap_pm_ops);
-#endif /* CONFIG_SUSPEND */
+ suspend_set_ops(omap_pm_ops);
err2:
return ret;