From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
To: Dan Carpenter <error27@gmail.com>, Deepak Sikri <deepak.sikri@st.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org, zhongqiu.han@oss.qualcomm.com
Subject: Re: [PATCH v2] cpufreq: spear: Fix an IS_ERR() vs NULL bug in spear1340_set_cpu_rate()
Date: Wed, 15 Jul 2026 08:10:53 +0800 [thread overview]
Message-ID: <a32691c8-e48d-472a-91bc-a3f4e9edb00a@oss.qualcomm.com> (raw)
In-Reply-To: <alZZzlY9rfdAvWac@stanley.mountain>
On 7/14/2026 11:46 PM, Dan Carpenter wrote:
> The clk_get_parent() function doesn't return error pointers, it returns
> NULL on error. Update the error checking to match.
>
> Fixes: 420993221175 ("cpufreq: SPEAr: Add CPUFreq driver")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> v2: fix subsystem prefix in subject
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
>
> drivers/cpufreq/spear-cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
> index 81a0780b2ebf..ffe5eda82f0b 100644
> --- a/drivers/cpufreq/spear-cpufreq.c
> +++ b/drivers/cpufreq/spear-cpufreq.c
> @@ -79,9 +79,9 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq)
> int ret = 0;
>
> sys_clk = clk_get_parent(spear_cpufreq.clk);
> - if (IS_ERR(sys_clk)) {
> + if (!sys_clk) {
> pr_err("failed to get cpu's parent (sys) clock\n");
> - return PTR_ERR(sys_clk);
> + return -EINVAL;
> }
>
> /* Set the rate of the source clock before changing the parent */
--
Thx and BRs,
Zhongqiu Han
prev parent reply other threads:[~2026-07-15 0:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 15:46 [PATCH v2] cpufreq: spear: Fix an IS_ERR() vs NULL bug in spear1340_set_cpu_rate() Dan Carpenter
2026-07-15 0:10 ` Zhongqiu Han [this message]
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=a32691c8-e48d-472a-91bc-a3f4e9edb00a@oss.qualcomm.com \
--to=zhongqiu.han@oss.qualcomm.com \
--cc=deepak.sikri@st.com \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.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