From af884a5dfdef06644bdbd7d54ca865616f24b256 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 31 Jul 2019 12:35:12 -0700 Subject: clk: qcom: Don't reference clk_init_data after registration A future patch is going to change semantics of clk_register() so that clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid referencing this member here so that we don't run into NULL pointer exceptions. Cc: Taniya Das Cc: Andy Gross Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20190731193517.237136-5-sboyd@kernel.org Acked-by: Taniya Das --- drivers/clk/qcom/clk-rpmh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/clk/qcom') diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index c3fd632af119..7a8a84dcb70d 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -396,6 +396,7 @@ static int clk_rpmh_probe(struct platform_device *pdev) hw_clks = desc->clks; for (i = 0; i < desc->num_clks; i++) { + const char *name = hw_clks[i]->init->name; u32 res_addr; size_t aux_data_len; const struct bcm_db *data; @@ -426,8 +427,7 @@ static int clk_rpmh_probe(struct platform_device *pdev) ret = devm_clk_hw_register(&pdev->dev, hw_clks[i]); if (ret) { - dev_err(&pdev->dev, "failed to register %s\n", - hw_clks[i]->init->name); + dev_err(&pdev->dev, "failed to register %s\n", name); return ret; } } -- cgit v1.2.3 From c42144139a383011327990a8c59a45f81b3493dd Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Thu, 15 Aug 2019 09:00:20 -0700 Subject: clk: qcom: Remove error prints from DFS registration These aren't useful and they reference the init structure name. Let's just drop them. Cc: Taniya Das Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20190815160020.183334-5-sboyd@kernel.org Acked-by: Taniya Das --- drivers/clk/qcom/clk-rcg2.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/clk/qcom') diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 8c02bffe50df..161a6498ed5a 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -1105,8 +1105,6 @@ static int clk_rcg2_enable_dfs(const struct clk_rcg_dfs_data *data, rcg->freq_tbl = NULL; - pr_debug("DFS registered for clk %s\n", init->name); - return 0; } @@ -1117,12 +1115,8 @@ int qcom_cc_register_rcg_dfs(struct regmap *regmap, for (i = 0; i < len; i++) { ret = clk_rcg2_enable_dfs(&rcgs[i], regmap); - if (ret) { - const char *name = rcgs[i].init->name; - - pr_err("DFS register failed for clk %s\n", name); + if (ret) return ret; - } } return 0; -- cgit v1.2.3