From: Sricharan R <sricharan@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
mturquette@baylibre.com, sboyd@codeaurora.org,
linux@armlinux.org.uk, andy.gross@linaro.org,
david.brown@linaro.org, rjw@rjwysocki.net,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
linux-pm@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 14/15] cpufreq: Add module to register cpufreq on Krait CPUs
Date: Tue, 6 Feb 2018 10:13:59 +0530 [thread overview]
Message-ID: <993dcf5e-a9b4-9434-08cf-7d385589800b@codeaurora.org> (raw)
In-Reply-To: <20180206042642.GG28462@vireshk-i7>
Hi Viresh,
On 2/6/2018 9:56 AM, Viresh Kumar wrote:
> On 06-02-18, 09:38, Sricharan R wrote:
>> diff --git a/drivers/cpufreq/qcom-cpufreq.c b/drivers/cpufreq/qcom-cpufreq.c
>> new file mode 100644
>> index 0000000..5b988d4
>> --- /dev/null
>> +++ b/drivers/cpufreq/qcom-cpufreq.c
>> @@ -0,0 +1,161 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// Copyright (c) 2018, The Linux Foundation. All rights reserved.
>> +
>> +#include <linux/cpu.h>
>> +#include <linux/err.h>
>> +#include <linux/init.h>
>> +#include <linux/io.h>
>> +#include <linux/kernel.h>
>> +#include <linux/module.h>
>> +#include <linux/of.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/pm_opp.h>
>> +#include <linux/slab.h>
>> +#include "cpufreq-dt.h"
>> +#include <linux/nvmem-consumer.h>
>
> I don't think you need all of these anymore, isn't it ? Can you cross check
> which ones are really required? For example, cpufreq-dt.h isn't required for
> sure.
>
oops. Had this in mind to fix the headers. But missed it. Sorry,
will fix and repost.
>> +static int __init qcom_cpufreq_driver_init(void)
>> +{
>> + struct device *cpu_dev;
>> + struct device_node *np;
>> + struct nvmem_cell *pvs_nvmem;
>> + int ret;
>> +
>> + cpu_dev = get_cpu_device(0);
>> + if (!cpu_dev)
>> + return -ENODEV;
>> +
>> + np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
>> + if (!np)
>> + return -ENOENT;
>> +
>> + if (!of_device_is_compatible(np, "operating-points-v2-krait-cpu")) {
>> + of_node_put(np);
>> + return -ENODEV;
>> + }
>> +
>> + pvs_nvmem = of_nvmem_cell_get(np, NULL);
>> + if (IS_ERR(pvs_nvmem)) {
>> + dev_err(cpu_dev, "Could not get nvmem cell\n");
>> + return PTR_ERR(pvs_nvmem);
>> + }
>> +
>> + of_node_put(np);
>> +
>> + ret = qcom_cpufreq_populate_opps(pvs_nvmem);
>> + if (ret)
>> + return ret;
>> +
>> + return PTR_ERR(platform_device_register_simple("cpufreq-dt",
>> + -1, NULL, 0));
>
> Wanna do proper error handling here? For example, unset OPP name on failure here
> so that resources get freed ?
>
ok, will fix things here.
Regards,
Sricharan
--
"QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2018-02-06 4:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 4:08 [PATCH v6 00/15] [v6] Krait clocks + Krait CPUfreq Sricharan R
2018-02-06 4:08 ` [PATCH v6 02/15] clk: mux: Split out register accessors for reuse Sricharan R
2018-02-06 4:08 ` [PATCH v6 03/15] clk: qcom: Add support for High-Frequency PLLs (HFPLLs) Sricharan R
2018-02-06 4:08 ` [PATCH v6 04/15] clk: qcom: Add HFPLL driver Sricharan R
2018-02-06 4:08 ` [PATCH v6 05/15] dt-bindings: clock: Document qcom,hfpll Sricharan R
2018-02-06 4:08 ` [PATCH v6 06/15] clk: qcom: Add MSM8960/APQ8064's HFPLLs Sricharan R
2018-02-06 4:08 ` [PATCH v6 07/15] clk: qcom: Add IPQ806X's HFPLLs Sricharan R
2018-02-06 4:08 ` [PATCH v6 08/15] clk: qcom: Add support for Krait clocks Sricharan R
2018-02-06 4:08 ` [PATCH v6 09/15] clk: qcom: Add KPSS ACC/GCC driver Sricharan R
2018-02-06 4:08 ` [PATCH v6 10/15] dt-bindings: arm: Document qcom,kpss-gcc Sricharan R
[not found] ` <1517890108-8140-1-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-02-06 4:08 ` [PATCH v6 01/15] ARM: Add Krait L2 register accessor functions Sricharan R
2018-02-06 4:08 ` [PATCH v6 11/15] clk: qcom: Add Krait clock controller driver Sricharan R
2018-02-06 4:08 ` [PATCH v6 12/15] dt-bindings: clock: Document qcom,krait-cc Sricharan R
2018-02-06 4:08 ` [PATCH v6 13/15] clk: qcom: Add safe switch hook for krait mux clocks Sricharan R
2018-02-06 4:08 ` [PATCH v6 14/15] cpufreq: Add module to register cpufreq on Krait CPUs Sricharan R
2018-02-06 4:26 ` Viresh Kumar
2018-02-06 4:43 ` Sricharan R [this message]
2018-02-06 4:08 ` [PATCH v6 15/15] dt-bindings: cpufreq: Document operating-points-v2-krait-cpu Sricharan R
2018-02-06 4:27 ` Viresh Kumar
2018-02-06 4:44 ` Sricharan R
2018-02-09 2:54 ` Rob Herring
2018-02-09 5:31 ` Sricharan R
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=993dcf5e-a9b4-9434-08cf-7d385589800b@codeaurora.org \
--to=sricharan@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=rjw@rjwysocki.net \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@codeaurora.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).