[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240720144425.0770a412@jic23-huawei>
Date: Sat, 20 Jul 2024 14:44:25 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Nuno Sá <noname.nuno@...il.com>
Cc: Alisa-Dariana Roman <alisadariana@...il.com>, Alisa-Dariana Roman
<alisa.roman@...log.com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Michael Hennerich <michael.hennerich@...log.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>, Rob
Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor
Dooley <conor+dt@...nel.org>
Subject: Re: [PATCH v7 4/4] iio: adc: ad7192: Add clock provider
On Thu, 18 Jul 2024 16:11:29 +0200
Nuno Sá <noname.nuno@...il.com> wrote:
> On Thu, 2024-07-18 at 00:25 +0300, Alisa-Dariana Roman wrote:
> > Internal clock of AD719X devices can be made available on MCLK2 pin. Add
> > clock provider to support this functionality when clock cells property
> > is present.
> >
> > Signed-off-by: Alisa-Dariana Roman <alisa.roman@...log.com>
> > ---
>
> minor thing below you may consider if a re-spin is needed...
>
> Reviewed-by: Nuno Sa <nuno.sa@...log.com>
> > +static int ad7192_register_clk_provider(struct ad7192_state *st)
> > +{
> > + struct device *dev = &st->sd.spi->dev;
> > + struct clk_init_data init = {};
> > + int ret;
> > +
> > + if (!device_property_present(dev, "#clock-cells"))
> > + return 0;
> > +
> > + if (!IS_ENABLED(CONFIG_COMMON_CLK))
> > + return 0;
> >
>
> nit: This could be the first test to do. No point in calling
> device_property_present() if CONFIG_COMMON_CLK is disabled. FWIW, the compiler should
> be smart enough to sort things out but it would still be better (for readability) to
> have this first.
>
Tweaked whilst applying.
Compiler probably can't figure it out as won't have enough visibility of the
implementation of device_property_present() to know it doesn't have side effects
deep in one of the indirect function calls that can generate.
Jonathan
> - Nuno Sá
>
>
Powered by blists - more mailing lists