From: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
To: Andrew Lunn <andrew@lunn.ch>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>
Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Russell King <linux@arm.linux.org.uk>,
Shawn Guo <shawn.guo@linaro.org>,
Gregory Clement <gregory.clement@free-electrons.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
Olof Johansson <olof@lixom.net>, Arnd Bergmann <arnd@arndb.de>,
Jason Cooper <jason@lakedaemon.net>
Subject: Re: [RFC PATCH v2 11/15] cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu nodes
Date: Thu, 18 Jul 2013 11:14:18 +0100 [thread overview]
Message-ID: <51E7BFFA.8010101@arm.com> (raw)
In-Reply-To: <51E7A63F.7020207@arm.com>
On 18/07/13 09:24, Sudeep KarkadaNagesha wrote:
> On 17/07/13 15:43, Andrew Lunn wrote:
>> On Wed, Jul 17, 2013 at 03:06:20PM +0100, Sudeep.KarkadaNagesha@arm.com wrote:
>>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>>
[...]
>>> diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c
>>> index c233ea6..18aa3eb 100644
>>> --- a/drivers/cpufreq/kirkwood-cpufreq.c
>>> +++ b/drivers/cpufreq/kirkwood-cpufreq.c
>>> @@ -13,6 +13,7 @@
>>> #include <linux/module.h>
>>> #include <linux/clk.h>
>>> #include <linux/clk-provider.h>
>>> +#include <linux/cpu.h>
>>> #include <linux/cpufreq.h>
>>> #include <linux/of.h>
>>> #include <linux/platform_device.h>
>>> @@ -165,6 +166,7 @@ static struct cpufreq_driver kirkwood_cpufreq_driver = {
>>> static int kirkwood_cpufreq_probe(struct platform_device *pdev)
>>> {
>>> struct device_node *np;
>>> + struct device *cpu_dev;
>>> struct resource *res;
>>> int err;
>>>
>>> @@ -175,9 +177,17 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
>>> if (IS_ERR(priv.base))
>>> return PTR_ERR(priv.base);
>>>
>>> - np = of_find_node_by_path("/cpus/cpu@0");
>>> - if (!np)
>>> + cpu_dev = get_cpu_device(0);
>>> + if (!cpu_dev) {
>>> + dev_err(&pdev->dev, "failed to get cpu device\n");
>>> return -ENODEV;
>>> + }
>>> +
>>> + np = of_node_get(cpu_dev->of_node);
>>> + if (!np) {
>>> + dev_err(&pdev->dev, "failed to get cpu device node\n");
>>> + return -ENODEV;
>>> + }
>>
>> Hi Sudeep
>>
>> Are we not going a bit backwards here? You are replacing two lines
>> with 10 lines.
>>
>> How about putting these 10 lines into some helper,
>> of_get_cpu_device()? It would be useful for spear, kirkwood and
>> imx6q, and maybe others.
>>
> Yes I realised that after making changes to this and pmac32 drivers. I
> have already made those changes in v3. I am waiting for more response
> before posting them.
>
I thought of placing this helper in include/linux/of_device.h but I see:
#include <linux/of_platform.h> /* temporary until merge */
Does this mean of_platform.h and of_device.h will be merged ?
If so, which will be the final merged one ? I would like to avoid
changing all the header file inclusions later in users of this new helper.
Regards,
Sudeep
next prev parent reply other threads:[~2013-07-18 10:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 14:06 [RFC PATCH v2 00/15] DT/core: update cpu device of_node Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 02/15] driver/core: cpu: initialize of_node in cpu's device struture Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 03/15] ARM: DT/kernel: define ARM specific arch_match_cpu_phys_id Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 06/15] drivers/bus: arm-cci: avoid parsing DT for cpu device nodes Sudeep.KarkadaNagesha
[not found] ` <1374069984-20567-1-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-07-17 14:06 ` [RFC PATCH v2 01/15] of: add support for retrieving cpu node for a given logical cpu index Sudeep.KarkadaNagesha-5wv7dgnIgG8
[not found] ` <1374069984-20567-2-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-07-17 14:30 ` Nicolas Pitre
2013-07-17 14:50 ` Rob Herring
2013-07-17 15:18 ` Sudeep KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 04/15] ARM: topology: remove hwid/MPIDR dependency from cpu_capacity Sudeep.KarkadaNagesha-5wv7dgnIgG8
2013-07-17 14:06 ` [RFC PATCH v2 05/15] ARM: mvebu: remove device tree parsing for cpu nodes Sudeep.KarkadaNagesha-5wv7dgnIgG8
2013-07-17 14:06 ` [RFC PATCH v2 07/15] cpufreq: imx6q-cpufreq: " Sudeep.KarkadaNagesha-5wv7dgnIgG8
2013-07-17 14:06 ` [RFC PATCH v2 08/15] cpufreq: cpufreq-cpu0: " Sudeep.KarkadaNagesha-5wv7dgnIgG8
2013-07-17 14:06 ` [RFC PATCH v2 09/15] cpufreq: highbank-cpufreq: " Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 10/15] cpufreq: spear-cpufreq: " Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 11/15] cpufreq: kirkwood-cpufreq: " Sudeep.KarkadaNagesha
2013-07-17 14:43 ` Andrew Lunn
2013-07-18 7:53 ` Viresh Kumar
2013-07-18 8:24 ` Sudeep KarkadaNagesha
2013-07-18 10:14 ` Sudeep KarkadaNagesha [this message]
2013-07-18 18:30 ` Rob Herring
2013-07-17 14:06 ` [RFC PATCH v2 12/15] cpufreq: arm_big_little: " Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 13/15] cpufreq: maple-cpufreq: " Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 14/15] cpufreq: pmac64-cpufreq: " Sudeep.KarkadaNagesha
2013-07-17 14:06 ` [RFC PATCH v2 15/15] cpufreq: pmac32-cpufreq: " Sudeep.KarkadaNagesha
2013-07-18 7:54 ` [RFC PATCH v2 00/15] DT/core: update cpu device of_node Viresh Kumar
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=51E7BFFA.8010101@arm.com \
--to=sudeep.karkadanagesha@arm.com \
--cc=Lorenzo.Pieralisi@arm.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=cpufreq@vger.kernel.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=olof@lixom.net \
--cc=rjw@sisk.pl \
--cc=rob.herring@calxeda.com \
--cc=shawn.guo@linaro.org \
--cc=viresh.kumar@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).