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

Nuno Sá
2024-02-20T12:20:55Z

On Tue, 2024-02-20 at 11:43 +0200, Dumitru Ceclan wrote:
> The AD7173 family offer a complete integrated Sigma-Delta ADC solution
> which can be used in high precision, low noise single channel
> applications or higher speed multiplexed applications. The Sigma-Delta
> ADC is intended primarily for measurement of signals close to DC but also
> delivers outstanding performance with input bandwidths out to ~10kHz.
>
> Reviewed-by: Andy Shevchenko <andy@kernel.org> # for changes up until V12
> Reviewed-by: Michael Walle <michael@walle.cc> # for gpio-regmap
> Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
> ---

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);
> + 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;

- Nuno Sá