clk: qcom: Add qcom_clk_hw_get_name()

The existing clk_hw_get_name() only works after the clock has been
registered with the framework since it relies on hw->core->name and
hw->core is NULL pre-registration. hw->init->name can be used
pre-registration, but this doesn't work post-registration since the
framework sets hw->init to NULL.

Provide qcom_clk_hw_get_name(), which can be called in both pre and
post-registration contexts.

Change-Id: I334e545f5112961b7ab6879daca55c70236338d6
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
This commit is contained in:
Mike Tipton 2020-11-04 16:40:10 -08:00 committed by Mike Tipton
parent 9c9f3ff339
commit f7f04fbfc6

View File

@ -84,4 +84,9 @@ int qcom_cc_runtime_init(struct platform_device *pdev,
int qcom_cc_runtime_suspend(struct device *dev);
int qcom_cc_runtime_resume(struct device *dev);
static inline const char *qcom_clk_hw_get_name(const struct clk_hw *hw)
{
return hw->init ? hw->init->name : clk_hw_get_name(hw);
}
#endif