[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260123084210.7ef1684c@jic23-huawei>
Date: Fri, 23 Jan 2026 08:42:10 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: rodrigo.alencar@...log.com, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org, Michael Hennerich
<Michael.Hennerich@...log.com>, Lars-Peter Clausen <lars@...afoo.de>, David
Lechner <dlechner@...libre.com>, Andy Shevchenko <andy@...nel.org>, Rob
Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor
Dooley <conor+dt@...nel.org>
Subject: Re: [PATCH 7/7] iio: amplifiers: ad8366: add device tree support
On Mon, 19 Jan 2026 15:47:46 +0100
Krzysztof Kozlowski <krzk@...nel.org> wrote:
> On 19/01/2026 15:37, Rodrigo Alencar via B4 Relay wrote:
> > + st->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> > + if (IS_ERR(st->reset_gpio))
> > + return dev_err_probe(dev, PTR_ERR(st->reset_gpio),
> > + "Failed to get reset GPIO\n");
> >
> > - st->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
> > - if (IS_ERR(st->enable_gpio))
> > - return dev_err_probe(dev, PTR_ERR(st->enable_gpio),
> > - "Failed to get enable GPIO\n");
> > + st->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
>
> No, you are changing the same line *third* time. you need to organize
> your patchset in logical way but also in a readable. You do not add
> incorrect code just to change it later.
>
> I do not see the reason behind removal of switch case. It's really
> independent change of OF support which must come with its own
> justification of affecting other platforms.
FWIW, I was about to write the same about this set needing a thorough
reorganize. From a quick look at this last patch I'm probably fine
with everything it contains, but it's 3+ patches rolled into one
and I'd also like the big array of chip_info broken up and the enum
gone as mentioned in earlier patch.
Thanks,
Jonathan
>
>
> > + if (IS_ERR(st->enable_gpio))
> > + return dev_err_probe(dev, PTR_ERR(st->enable_gpio),
> > + "Failed to get enable GPIO\n");
> >
> > - indio_dev->channels = ada4961_channels;
> > - indio_dev->num_channels = ARRAY_SIZE(ada4961_channels);
> > - break;
> > - default:
> > - return dev_err_probe(dev, -EINVAL, "Invalid device ID\n");
> > - }
> > -
> > - st->info = &ad8366_infos[st->type];
> > indio_dev->name = spi_get_device_id(spi)->name;
> > indio_dev->info = &ad8366_info;
> > + indio_dev->channels = ad8366_channels;
> > + indio_dev->num_channels = st->info->num_channels;
> > indio_dev->modes = INDIO_DIRECT_MODE;
> >
> > - ret = ad8366_write(indio_dev, 0, 0);
> > + ret = ad8366_write_code(st);
> > if (ret < 0)
> > return dev_err_probe(dev, ret, "failed to write initial gain\n");
> >
> > @@ -384,24 +322,41 @@ static int ad8366_probe(struct spi_device *spi)
> > }
>
>
> Best regards,
> Krzysztof
>
Powered by blists - more mailing lists