* [PATCH] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
@ 2022-12-08 14:39 Dmitry Baryshkov
2022-12-09 1:21 ` Stephen Boyd
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Baryshkov @ 2022-12-08 14:39 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Stephen Boyd; +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>
---
drivers/clk/qcom/clk-spmi-pmic-div.c | 13 +++++--------
1 file changed, 5 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..aa015c51ab4f 100644
--- a/drivers/clk/qcom/clk-spmi-pmic-div.c
+++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
@@ -175,6 +175,10 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
.round_rate = clk_spmi_pmic_div_round_rate,
};
+static const struct clk_parent_data clk_spmi_pmic_parent_data = {
+ .index = 0,
+};
+
struct spmi_pmic_div_clk_cc {
int nclks;
struct clkdiv clks[];
@@ -204,7 +208,6 @@ 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;
int nclks, i, ret, cxo_hz;
char name[20];
u32 start;
@@ -246,14 +249,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 = &clk_spmi_pmic_parent_data;
init.num_parents = 1;
init.ops = &clk_spmi_pmic_div_ops;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
2022-12-08 14:39 [PATCH] clk: qcom: clk-spmi-pmic-div: convert to use parent_data Dmitry Baryshkov
@ 2022-12-09 1:21 ` Stephen Boyd
2022-12-10 19:10 ` Dmitry Baryshkov
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2022-12-09 1:21 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Dmitry Baryshkov; +Cc: linux-arm-msm, linux-clk
Quoting Dmitry Baryshkov (2022-12-08 06:39:45)
> diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
> index f2cf55cee2fd..aa015c51ab4f 100644
> --- a/drivers/clk/qcom/clk-spmi-pmic-div.c
> +++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
> @@ -175,6 +175,10 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
> .round_rate = clk_spmi_pmic_div_round_rate,
> };
>
> +static const struct clk_parent_data clk_spmi_pmic_parent_data = {
> + .index = 0,
> +};
Why not put this on the stack? clk core should be deep copying.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: qcom: clk-spmi-pmic-div: convert to use parent_data
2022-12-09 1:21 ` Stephen Boyd
@ 2022-12-10 19:10 ` Dmitry Baryshkov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2022-12-10 19:10 UTC (permalink / raw)
To: Stephen Boyd; +Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, linux-clk
On Fri, 9 Dec 2022 at 04:21, Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Dmitry Baryshkov (2022-12-08 06:39:45)
> > diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
> > index f2cf55cee2fd..aa015c51ab4f 100644
> > --- a/drivers/clk/qcom/clk-spmi-pmic-div.c
> > +++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
> > @@ -175,6 +175,10 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
> > .round_rate = clk_spmi_pmic_div_round_rate,
> > };
> >
> > +static const struct clk_parent_data clk_spmi_pmic_parent_data = {
> > + .index = 0,
> > +};
>
> Why not put this on the stack? clk core should be deep copying.
Thanks, fixed in v2
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-10 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 14:39 [PATCH] clk: qcom: clk-spmi-pmic-div: convert to use parent_data Dmitry Baryshkov
2022-12-09 1:21 ` Stephen Boyd
2022-12-10 19:10 ` Dmitry Baryshkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.