Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v2] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
@ 2022-12-10 19:10 Dmitry Baryshkov
  2023-01-11  5:09 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2022-12-10 19:10 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Stephen Boyd,
	Michael Turquette
  Cc: linux-arm-msm, linux-clk

The clk-spmi-pmic-div driver gets the parent name from the first (and
the only) clock parent. So, use parent data, index 0 to setup the clock.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---

Changes since v1:
- Moved parent_data to be the onstack var.

---
 drivers/clk/qcom/clk-spmi-pmic-div.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
index f2cf55cee2fd..f846be285f51 100644
--- a/drivers/clk/qcom/clk-spmi-pmic-div.c
+++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
@@ -204,7 +204,7 @@ static int spmi_pmic_clkdiv_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 	struct device *dev = &pdev->dev;
 	struct device_node *of_node = dev->of_node;
-	const char *parent_name;
+	struct clk_parent_data parent_data = { .index = 0, };
 	int nclks, i, ret, cxo_hz;
 	char name[20];
 	u32 start;
@@ -246,14 +246,8 @@ static int spmi_pmic_clkdiv_probe(struct platform_device *pdev)
 	cxo_hz = clk_get_rate(cxo);
 	clk_put(cxo);
 
-	parent_name = of_clk_get_parent_name(of_node, 0);
-	if (!parent_name) {
-		dev_err(dev, "missing parent clock\n");
-		return -ENODEV;
-	}
-
 	init.name = name;
-	init.parent_names = &parent_name;
+	init.parent_data = &parent_data;
 	init.num_parents = 1;
 	init.ops = &clk_spmi_pmic_div_ops;
 
-- 
2.30.2


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

* Re: [PATCH v2] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
  2022-12-10 19:10 [PATCH v2] clk: qcom: clk-spmi-pmic-div: convert to use parent_data Dmitry Baryshkov
@ 2023-01-11  5:09 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2023-01-11  5:09 UTC (permalink / raw)
  To: dmitry.baryshkov, konrad.dybcio, agross, mturquette, sboyd
  Cc: linux-arm-msm, linux-clk

On Sat, 10 Dec 2022 22:10:13 +0300, Dmitry Baryshkov wrote:
> The clk-spmi-pmic-div driver gets the parent name from the first (and
> the only) clock parent. So, use parent data, index 0 to setup the clock.
> 
> 

Applied, thanks!

[1/1] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
      commit: a622c1dc84d920f231df539b3013c58a15fa2a19

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2023-01-11  5:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-10 19:10 [PATCH v2] clk: qcom: clk-spmi-pmic-div: convert to use parent_data Dmitry Baryshkov
2023-01-11  5:09 ` Bjorn Andersson

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