Re: [PATCH] cpufreq: Fix an IS_ERR() vs NULL bug in spear1340_set_cpu_rate()

Viresh Kumar <[email protected]> Mon, 13 Jul 2026 09:31:12 +0530
Newsgroups org.kernel.vger.kernel-janitors,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm
Message-ID <sejbfcic3gey5p4uxgituyizdttimxhlrl4kwer27b4g7j5i6o@yvjnioeplypl>
On 12-07-26, 21:30, Zhongqiu Han wrote:
> On 7/11/2026 3:34 AM, Dan Carpenter wrote:
> > The clk_get_parent() function doesn't return error pointers, it returns
> > NULL on error.  Update the error checking to match.

origin/master:include/linux/clk.h

/**
 * clk_get_parent - get the parent clock source for this clock
 * @clk: clock source
 *
 * Returns struct clk corresponding to parent clock source, or
 * valid IS_ERR() condition containing errno.
 */
struct clk *clk_get_parent(struct clk *clk);

I think this is the source of the confusion.

> > 
> > Fixes: 420993221175 ("cpufreq: SPEAr: Add CPUFreq driver")
> > Signed-off-by: Dan Carpenter <[email protected]>
> 
> Nice catch, thanks for the fix.
> 
> Nit: the subject is too generic and can be misread as a cpufreq core
> fix. It is better to scope it to the driver, e.g. "cpufreq: spear: ...".

Right.

-- 
viresh