Re: [PATCH v3 2/2] iio: adc: add ltc2309 support

From: Jonathan Cameron
Date: Sun Sep 10 2023 - 10:06:05 EST


On Sun, 3 Sep 2023 12:43:41 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> On Mon, 28 Aug 2023 22:41:35 -0400
> Liam Beguin <liambeguin@xxxxxxxxx> wrote:
>
> > The LTC2309 is an 8-Channel, 12-Bit SAR ADC with an I2C Interface.
> >
> > This implements support for all single-ended and differential channels,
> > in unipolar mode only.
> >
> > Signed-off-by: Liam Beguin <liambeguin@xxxxxxxxx>
> Hi Liam,
>
> A few really small editorial bits in here. I'll fix them whilst applying.
> Series applied to the togreg branch of iio.git
>
> Note I will be rebasing the tree on rc1 once available and in the meantime
> this will only be pushed out as testing.

A couple more static analysis reports came in (unreachable return in one pace
and a missing static. I've fixed up in my tree.

Thanks,

Jonathan

>
> Thanks,
>
> Jonathan
>
>
>
> > +/**
> > + * struct ltc2309 - internal device data structure
> > + * @dev: Device reference
> > + * @client: I2C reference
> > + * @vref: External reference source
> > + * @lock: Lock to serialize data access
> > + * @vref_mv Internal voltage reference
>
> Missing : which is what the bot picked up on.
>
> > + */
> > +struct ltc2309 {
> > + struct device *dev;
> > + struct i2c_client *client;
> > + struct regulator *vref;
> > + struct mutex lock; /* serialize data access */
> > + int vref_mv;
> > +};
>
> > +
> > +void ltc2309_regulator_disable(void *regulator)
> > +{
> > + struct regulator *r = (struct regulator *)regulator;
>
> Never any need to explicitly cast from a void * to any other pointer type.
> (C spec says it is always fine to do this :)
>
> Given type is obvious from use, can just do
> regulator_disable(regulator);
> and lose the local variable.
>
> > +
> > + regulator_disable(r);
> > +}
>
> ..
> > +
> > +static const struct of_device_id ltc2309_of_match[] = {
> > + { .compatible = "lltc,ltc2309" },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, ltc2309_of_match);
> > +
> > +static const struct i2c_device_id ltc2309_id[] = {
> > + { "ltc2309" },
> > + {}
>
> Trivial but space between { and } for consistency.
>
>