[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251208170859.00006f2f@huawei.com>
Date: Mon, 8 Dec 2025 17:08:59 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
CC: Jonathan Cameron <jic23@...nel.org>, Oleksij Rempel
<o.rempel@...gutronix.de>, Rob Herring <robh@...nel.org>, "Krzysztof
Kozlowski" <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, "David
Jander" <david@...tonic.nl>, <kernel@...gutronix.de>,
<linux-kernel@...r.kernel.org>, <linux-iio@...r.kernel.org>,
<devicetree@...r.kernel.org>, Andy Shevchenko <andy@...nel.org>, "David
Lechner" <dlechner@...libre.com>, Nuno Sá
<nuno.sa@...log.com>
Subject: Re: [PATCH v4 2/2] iio: adc: Add TI ADS131M0x ADC driver
On Mon, 8 Dec 2025 00:59:09 +0200
Andy Shevchenko <andriy.shevchenko@...el.com> wrote:
> 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@...gutronix.de> 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.
I'd think an optional clock is optional whether or not the generic clock
stuff is built. Hence should use devm_clk_get_optional_enabled()
That one I agree should be stubbed to return NULL (which it is)
Ah well, I don't really care about the answer, just diverted me for
a few mins so I thought I'd comment.
Jonathan
>
> > > + 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");
> > > + }
>
Powered by blists - more mailing lists