[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230910150333.472437be@jic23-huawei>
Date: Sun, 10 Sep 2023 15:03:33 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Liam Beguin <liambeguin@...il.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v3 2/2] iio: adc: add ltc2309 support
On Sun, 3 Sep 2023 12:43:41 +0100
Jonathan Cameron <jic23@...nel.org> wrote:
> On Mon, 28 Aug 2023 22:41:35 -0400
> Liam Beguin <liambeguin@...il.com> 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@...il.com>
> 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.
>
>
Powered by blists - more mailing lists