shmobile: prepare to allow export of sh_pm_runtime_init()
Quoted 18 lines · Ben Dooks
In a multi-platform kernel, we cannot simply add this as a initcall as it may be built and run on archtiectures other than the SHMOBILE so export the
sh_pm_runtime_init()call to be used from the machine specific code.Signed-off-by Ben Dooks <[email protected]>--- drivers/sh/pm_runtime.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/sh/pm_runtime.c +0
-0@@ -42,16 +42,19 @@ static struct pm_clk_notifier_block platform_bus_notifier = { .con_ids = { NULL, }, };
drivers/sh/pm_runtime.c static struct pm_clk_notifier_block platform_bus_notifier = { · line 50
Quoted 10 lines
drivers/sh/pm_runtime.c +4
-2-static int __init sh_pm_runtime_init (void ) +static bool default_pm_on; + +int __init sh_pm_runtime_init (void ) { + default_pm_on = true;pm_clk_add_notifier (&platform_bus_type, &platform_bus_notifier);return 0 ; } -core_initcall (sh_pm_runtime_init);
This appears to break initialisation until 4/6 "ARM: shmobile: r8a7790:
call sh_pm_runtime_init()" is applied. I think patches 2-4 must all be folded together.
Ben.
Quoted 8 lines
drivers/sh/pm_runtime.c +2
-1static int __init sh_pm_runtime_late_init (void ) { -pm_genpd_poweroff_unused (); +if (default_pm_on) +pm_genpd_poweroff_unused ();return 0 ; }late_initcall (sh_pm_runtime_late_init);