Re: [RFC PATCH v1] media: v4l2-common: Add a helper for obtaining the clock producer

From: Mehdi Djait
Date: Mon Mar 10 2025 - 08:15:45 EST


Hi Sakari,

On Fri, Mar 07, 2025 at 11:57:01AM +0000, Sakari Ailus wrote:
> On Fri, Mar 07, 2025 at 11:51:58AM +0000, Sakari Ailus wrote:
> > > + int ret;
> > > +
> > > + clk = devm_clk_get_optional(dev, id);
> > > + if (clk || IS_ERR(clk))
>
> I forgot this bit earlier. The IS_ERR() check is redundant.
>

Wouldn't you say that this helps with readability even if it is
redundant ? This will warn the users of this helper that the call
may fail and return early ?

--
Kind Regards
Mehdi Djait