From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: mturquette@baylibre.com, lee.jones@linaro.org,
xuwei5@hisilicon.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH V2] clk: hi6220: Add the hi655x's pmic clock
Date: Sun, 16 Apr 2017 22:57:13 +0200 [thread overview]
Message-ID: <20170416205713.GW2078@mai> (raw)
In-Reply-To: <20170412150245.GK7065@codeaurora.org>
On Wed, Apr 12, 2017 at 08:02:45AM -0700, Stephen Boyd wrote:
> On 04/08, Daniel Lezcano wrote:
> >
> > Example:
> > pmic: pmic@f8000000 {
> > @@ -24,4 +29,5 @@ Example:
> > interrupt-controller;
> > #interrupt-cells = <2>;
> > pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
> > + clock-cells = <0>;
>
> Should be #clock-cells instead.
Ok.
> > +static int hi655x_clk_probe(struct platform_device *pdev)
> > +{
> > + struct device *parent = pdev->dev.parent;
> > + struct hi655x_pmic *hi655x = dev_get_drvdata(parent);
> > + struct clk_init_data *hi655x_clk_init;
>
> This can just go onto the stack? We don't need it around after
> probe.
Agree.
> > + struct hi655x_clk *hi655x_clk;
> > + const char *clk_name = "hi655x-clk";
> > + int ret;
> > +
> > + hi655x_clk = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk), GFP_KERNEL);
> > + if (!hi655x_clk)
> > + return -ENOMEM;
> > +
> > + hi655x_clk_init = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk_init),
> > + GFP_KERNEL);
> > + if (!hi655x_clk_init)
> > + return -ENOMEM;
> > +
> > + of_property_read_string_index(parent->of_node, "clock-output-names",
> > + 0, &clk_name);
> > +
> > + hi655x_clk_init->name = clk_name;
> > + hi655x_clk_init->ops = &hi655x_clk_ops;
> > +
> > + hi655x_clk->clk_hw.init = hi655x_clk_init;
> > + hi655x_clk->hi655x = hi655x;
> > +
> > + platform_set_drvdata(pdev, hi655x_clk);
> > +
> > + ret = devm_clk_hw_register(&pdev->dev, &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = of_clk_add_hw_provider(parent->of_node, of_clk_hw_simple_get,
> > + &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = clk_hw_register_clkdev(&hi655x_clk->clk_hw, clk_name, NULL);
>
> Missed this last time. Do you use this clkdev lookup? The name is
> usually supposed to be based on what the device is expecting,
> instead of clk_name, and we would want some device name for the
> third argument here.
I'm not sure to get your comment. Are you saying the clk_name should be the
third argument?
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
WARNING: multiple messages have this Message-ID (diff)
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] clk: hi6220: Add the hi655x's pmic clock
Date: Sun, 16 Apr 2017 22:57:13 +0200 [thread overview]
Message-ID: <20170416205713.GW2078@mai> (raw)
In-Reply-To: <20170412150245.GK7065@codeaurora.org>
On Wed, Apr 12, 2017 at 08:02:45AM -0700, Stephen Boyd wrote:
> On 04/08, Daniel Lezcano wrote:
> >
> > Example:
> > pmic: pmic at f8000000 {
> > @@ -24,4 +29,5 @@ Example:
> > interrupt-controller;
> > #interrupt-cells = <2>;
> > pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
> > + clock-cells = <0>;
>
> Should be #clock-cells instead.
Ok.
> > +static int hi655x_clk_probe(struct platform_device *pdev)
> > +{
> > + struct device *parent = pdev->dev.parent;
> > + struct hi655x_pmic *hi655x = dev_get_drvdata(parent);
> > + struct clk_init_data *hi655x_clk_init;
>
> This can just go onto the stack? We don't need it around after
> probe.
Agree.
> > + struct hi655x_clk *hi655x_clk;
> > + const char *clk_name = "hi655x-clk";
> > + int ret;
> > +
> > + hi655x_clk = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk), GFP_KERNEL);
> > + if (!hi655x_clk)
> > + return -ENOMEM;
> > +
> > + hi655x_clk_init = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk_init),
> > + GFP_KERNEL);
> > + if (!hi655x_clk_init)
> > + return -ENOMEM;
> > +
> > + of_property_read_string_index(parent->of_node, "clock-output-names",
> > + 0, &clk_name);
> > +
> > + hi655x_clk_init->name = clk_name;
> > + hi655x_clk_init->ops = &hi655x_clk_ops;
> > +
> > + hi655x_clk->clk_hw.init = hi655x_clk_init;
> > + hi655x_clk->hi655x = hi655x;
> > +
> > + platform_set_drvdata(pdev, hi655x_clk);
> > +
> > + ret = devm_clk_hw_register(&pdev->dev, &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = of_clk_add_hw_provider(parent->of_node, of_clk_hw_simple_get,
> > + &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = clk_hw_register_clkdev(&hi655x_clk->clk_hw, clk_name, NULL);
>
> Missed this last time. Do you use this clkdev lookup? The name is
> usually supposed to be based on what the device is expecting,
> instead of clk_name, and we would want some device name for the
> third argument here.
I'm not sure to get your comment. Are you saying the clk_name should be the
third argument?
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
xuwei5-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V2] clk: hi6220: Add the hi655x's pmic clock
Date: Sun, 16 Apr 2017 22:57:13 +0200 [thread overview]
Message-ID: <20170416205713.GW2078@mai> (raw)
In-Reply-To: <20170412150245.GK7065-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On Wed, Apr 12, 2017 at 08:02:45AM -0700, Stephen Boyd wrote:
> On 04/08, Daniel Lezcano wrote:
> >
> > Example:
> > pmic: pmic@f8000000 {
> > @@ -24,4 +29,5 @@ Example:
> > interrupt-controller;
> > #interrupt-cells = <2>;
> > pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
> > + clock-cells = <0>;
>
> Should be #clock-cells instead.
Ok.
> > +static int hi655x_clk_probe(struct platform_device *pdev)
> > +{
> > + struct device *parent = pdev->dev.parent;
> > + struct hi655x_pmic *hi655x = dev_get_drvdata(parent);
> > + struct clk_init_data *hi655x_clk_init;
>
> This can just go onto the stack? We don't need it around after
> probe.
Agree.
> > + struct hi655x_clk *hi655x_clk;
> > + const char *clk_name = "hi655x-clk";
> > + int ret;
> > +
> > + hi655x_clk = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk), GFP_KERNEL);
> > + if (!hi655x_clk)
> > + return -ENOMEM;
> > +
> > + hi655x_clk_init = devm_kzalloc(&pdev->dev, sizeof(*hi655x_clk_init),
> > + GFP_KERNEL);
> > + if (!hi655x_clk_init)
> > + return -ENOMEM;
> > +
> > + of_property_read_string_index(parent->of_node, "clock-output-names",
> > + 0, &clk_name);
> > +
> > + hi655x_clk_init->name = clk_name;
> > + hi655x_clk_init->ops = &hi655x_clk_ops;
> > +
> > + hi655x_clk->clk_hw.init = hi655x_clk_init;
> > + hi655x_clk->hi655x = hi655x;
> > +
> > + platform_set_drvdata(pdev, hi655x_clk);
> > +
> > + ret = devm_clk_hw_register(&pdev->dev, &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = of_clk_add_hw_provider(parent->of_node, of_clk_hw_simple_get,
> > + &hi655x_clk->clk_hw);
> > + if (ret)
> > + return ret;
> > +
> > + ret = clk_hw_register_clkdev(&hi655x_clk->clk_hw, clk_name, NULL);
>
> Missed this last time. Do you use this clkdev lookup? The name is
> usually supposed to be based on what the device is expecting,
> instead of clk_name, and we would want some device name for the
> third argument here.
I'm not sure to get your comment. Are you saying the clk_name should be the
third argument?
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-04-16 20:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-08 20:30 [PATCH V2] clk: hi6220: Add the hi655x's pmic clock Daniel Lezcano
2017-04-08 20:30 ` Daniel Lezcano
2017-04-08 20:30 ` Daniel Lezcano
2017-04-11 14:06 ` Lee Jones
2017-04-11 14:06 ` Lee Jones
2017-04-11 21:19 ` Daniel Lezcano
2017-04-11 21:19 ` Daniel Lezcano
2017-04-11 21:19 ` Daniel Lezcano
2017-04-12 8:00 ` Lee Jones
2017-04-12 8:00 ` Lee Jones
2017-04-12 12:10 ` Daniel Lezcano
2017-04-12 12:10 ` Daniel Lezcano
2017-04-12 12:10 ` Daniel Lezcano
2017-04-12 13:34 ` Lee Jones
2017-04-12 13:34 ` Lee Jones
2017-04-12 15:02 ` Stephen Boyd
2017-04-12 15:02 ` Stephen Boyd
2017-04-16 20:57 ` Daniel Lezcano [this message]
2017-04-16 20:57 ` Daniel Lezcano
2017-04-16 20:57 ` Daniel Lezcano
2017-04-19 16:00 ` Stephen Boyd
2017-04-19 16:00 ` Stephen Boyd
2017-04-19 19:47 ` Daniel Lezcano
2017-04-19 19:47 ` Daniel Lezcano
2017-04-22 2:14 ` Stephen Boyd
2017-04-22 2:14 ` Stephen Boyd
2017-04-24 9:31 ` Lee Jones
2017-04-24 9:31 ` Lee Jones
2017-04-24 9:43 ` Daniel Lezcano
2017-04-24 9:43 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170416205713.GW2078@mai \
--to=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@codeaurora.org \
--cc=xuwei5@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.