Re: [PATCH v2 2/7] iio: temperature: ltc2983: Use local device pointer consistently
From: Jonathan Cameron
Date: Sat May 16 2026 - 12:46:29 EST
On Thu, 14 May 2026 17:46:49 +0300
Liviu Stan <liviu.stan@xxxxxxxxxx> wrote:
> Some functions define a local 'dev' pointer but still use bare
> '&st->spi->dev' in some code paths, and some don't have it at all.
> Replace all bare references with the local pointer for consistency.
>
> Fixes: f110f3188e5639c81c457b2b831d40dfe3891bdb ("iio: temperature: Add support for LTC2983")
> Signed-off-by: Liviu Stan <liviu.stan@xxxxxxxxxx>
> ---
> Changes in v2:
> - New patch.
>
> drivers/iio/temperature/ltc2983.c | 81 ++++++++++++++++++-------------
> 1 file changed, 46 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
> index a292274e6ff0..e74ea4f87ec9 100644
> --- a/drivers/iio/temperature/ltc2983.c
> +++ b/drivers/iio/temperature/ltc2983.c
> @@ -351,6 +351,7 @@ static int __ltc2983_chan_assign_common(struct ltc2983_data *st,
> const struct ltc2983_sensor *sensor,
> u32 chan_val)
> {
> + struct device *dev = &st->spi->dev;
Why would you do that if no users in the function? Bring it in when it is
useful only. Note sashiko also spotted this..
Seems that you missed a dev_dbg() call that should have used it just after this.
(that I didn't know but sashiko called it out ;)
Again, a patch by patch build would almost certainly have thrown a warning on this.