public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: include cc device name into error messages
@ 2023-04-17 11:46 Dmitry Baryshkov
  2023-04-17 23:38 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2023-04-17 11:46 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Stephen Boyd,
	Michael Turquette, Taniya Das
  Cc: linux-arm-msm, linux-clk

To ease debugging of the incorrect clock configurations, add the name of
clock controller to the "invalid index" error message.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/clk/qcom/common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 75f09e6e057e..7dcf818e1dd9 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -19,6 +19,7 @@
 
 struct qcom_cc {
 	struct qcom_reset_controller reset;
+	struct device *dev;
 	struct clk_regmap **rclks;
 	size_t num_rclks;
 };
@@ -227,7 +228,7 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
 	unsigned int idx = clkspec->args[0];
 
 	if (idx >= cc->num_rclks) {
-		pr_err("%s: invalid index %u\n", __func__, idx);
+		dev_err(cc->dev, "%s: requested invalid clock index %u\n", __func__, idx);
 		return ERR_PTR(-EINVAL);
 	}
 
@@ -251,6 +252,8 @@ int qcom_cc_really_probe(struct platform_device *pdev,
 	if (!cc)
 		return -ENOMEM;
 
+	cc->dev = dev;
+
 	reset = &cc->reset;
 	reset->rcdev.of_node = dev->of_node;
 	reset->rcdev.ops = &qcom_reset_ops;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: qcom: include cc device name into error messages
  2023-04-17 11:46 [PATCH] clk: qcom: include cc device name into error messages Dmitry Baryshkov
@ 2023-04-17 23:38 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2023-04-17 23:38 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Dmitry Baryshkov, Konrad Dybcio,
	Michael Turquette, Taniya Das
  Cc: linux-arm-msm, linux-clk

Quoting Dmitry Baryshkov (2023-04-17 04:46:59)
> diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> index 75f09e6e057e..7dcf818e1dd9 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
> @@ -19,6 +19,7 @@
>  
>  struct qcom_cc {
>         struct qcom_reset_controller reset;
> +       struct device *dev;
>         struct clk_regmap **rclks;
>         size_t num_rclks;
>  };
> @@ -227,7 +228,7 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
>         unsigned int idx = clkspec->args[0];
>  
>         if (idx >= cc->num_rclks) {
> -               pr_err("%s: invalid index %u\n", __func__, idx);
> +               dev_err(cc->dev, "%s: requested invalid clock index %u\n", __func__, idx);

Maybe also add the regmap name if it is set? Sometimes we have multiple
regmaps for one clk controller device.

And can you remove the function name at the same time? It will be pretty
easy to pinpoint this function now with the device name in it.

>                 return ERR_PTR(-EINVAL);
>         }
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 23:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-17 11:46 [PATCH] clk: qcom: include cc device name into error messages Dmitry Baryshkov
2023-04-17 23:38 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox