Re: [PATCH v4 2/2] iio: adc: Add TI ADS131M0x ADC driver

From: Andy Shevchenko

Date: Sun Dec 07 2025 - 17:59:15 EST


On Sun, Dec 07, 2025 at 07:33:13PM +0000, Jonathan Cameron wrote:
> On Tue, 18 Nov 2025 15:18:21 +0100
> Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

...

> > + clk = devm_clk_get_enabled(dev, NULL);
>
> This surprised me, so I went digging. Anyone know why
> the stub returns NULL? Given that the normal function doesn't have
> that as an allowed return value that seems really odd.
>
> Still, it does, so this code is fine if odd.

I believe it has to do something with an optional clocks or so, but OTOH
I think it's so odd that may be considered as a bug in CCF APIs.

> > + if (IS_ERR_OR_NULL(clk)) {
> > + if (IS_ERR(clk))
> > + ret = PTR_ERR(clk);
> > + else
> > + ret = -ENODEV;
> > +
> > + return dev_err_probe(dev, ret, "clk get enabled failed\n");
> > + }

--
With Best Regards,
Andy Shevchenko