diff --git a/drivers/clk/qcom/clk-debug.c b/drivers/clk/qcom/clk-debug.c index 80fd26e84565..285d80a083ad 100644 --- a/drivers/clk/qcom/clk-debug.c +++ b/drivers/clk/qcom/clk-debug.c @@ -25,6 +25,7 @@ static struct clk_hw *measure; static bool debug_suspend; static bool debug_suspend_atomic; +static bool qcom_clk_debug_inited; static struct dentry *clk_debugfs_suspend; static struct dentry *clk_debugfs_suspend_atomic; @@ -765,6 +766,10 @@ void clk_common_debug_init(struct clk_hw *hw, struct dentry *dentry) debugfs_create_file("clk_print_regs", 0444, dentry, hw, &clock_print_hw_fops); + if (!qcom_clk_debug_inited) { + clk_debug_init(); + qcom_clk_debug_inited = true; + } } static int clk_list_rate_vdd_level(struct clk_hw *hw, unsigned int rate) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index a45119c50b80..88cce2535199 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2013-2014, 2017-2021, The Linux Foundation. * All rights reserved. + * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -589,12 +590,6 @@ int qcom_cc_runtime_suspend(struct device *dev) } EXPORT_SYMBOL(qcom_cc_runtime_suspend); -static int __init qcom_clk_init(void) -{ - return clk_debug_init(); -} -subsys_initcall(qcom_clk_init); - static void __exit qcom_clk_exit(void) { clk_debug_exit();