Re: [PATCH v13 3/3] iio: adc: ad7173: add AD7173 driver

From: Andy Shevchenko
Date: Tue Feb 20 2024 - 09:19:47 EST


On Tue, Feb 20, 2024 at 01:20:52PM +0100, Nuno Sá wrote:
> On Tue, 2024-02-20 at 11:43 +0200, Dumitru Ceclan wrote:

..

> Another thing that caught my attention

> > +static int ad7173_register_clk_provider(struct iio_dev *indio_dev)
> > +{
> > + struct ad7173_state *st = iio_priv(indio_dev);
> > + struct device *dev = indio_dev->dev.parent;
> > + struct fwnode_handle *fw_node = dev_fwnode(dev);

Since you used this context, I would also like fw_node to be renamed to fwnode
(in case it will still be used).

> > + struct clk_init_data init = {};
> > + int ret;
> > +
> > + if (!fw_node)
> > + return 0;
>
> I think that better than the above check (do we really have any case where fw_node is
> NULL?) is to have:
>
> if (!IS_ENABLED(CONFIG_COMMON_CLK))
> return 0;

--
With Best Regards,
Andy Shevchenko