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

From: Dan Carpenter

Date: Mon Jul 13 2026 - 03:56:56 EST


On Mon, Jul 13, 2026 at 09:31:12AM +0530, Viresh Kumar wrote:
> 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.
>

I'll send a separate patch to update that documentation.

regards,
dan carpenter