msm: xo: Initialize debugfs from initcall
If msm xo is compiled in but msm_xo_init() hasn't been called we
still initialize the debugfs node in a late initcall. Doing so
exposes a file that when cated will Oops because the lists for
the xo voters aren't initialized. Move the debugfs initialization
to the init function so that the node is not created unless the
xo driver is initialized.
Change-Id: Ibee2efde5453af065b177001572d3c8c1c5912ed
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/msm_xo.c b/arch/arm/mach-msm/msm_xo.c
index f7d2bcb..78fd399 100644
--- a/arch/arm/mach-msm/msm_xo.c
+++ b/arch/arm/mach-msm/msm_xo.c
@@ -109,7 +109,8 @@
&msm_xo_voters_ops);
return IS_ERR(entry) ? PTR_ERR(entry) : 0;
}
-late_initcall(msm_xo_debugfs_init);
+#else
+static int __init msm_xo_debugfs_init(void) { return 0; }
#endif
static int msm_xo_update_vote(struct msm_xo *xo)
@@ -332,6 +333,7 @@
ret = msm_rpmrs_set(MSM_RPM_CTX_SET_SLEEP, cmd, 1);
if (ret)
goto out;
+ msm_xo_debugfs_init();
out:
return ret;
}