From: Jonathan Cameron <jic23@kernel.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: rodrigo.alencar@analog.com, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
Michael Hennerich <Michael.Hennerich@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Subject: Re: [PATCH 7/7] iio: amplifiers: ad8366: add device tree support
Date: Fri, 23 Jan 2026 08:42:10 +0000 [thread overview]
Message-ID: <20260123084210.7ef1684c@jic23-huawei> (raw)
In-Reply-To: <1ae2f7de-f1f9-4f45-b38f-b68089fc017c@kernel.org>
On Mon, 19 Jan 2026 15:47:46 +0100
Krzysztof Kozlowski <krzk@kernel.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
>
prev parent reply other threads:[~2026-01-23 8:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 14:36 [PATCH 0/7] iio: amplifiers: ad8366: driver update and dt support Rodrigo Alencar via B4 Relay
2026-01-19 14:36 ` [PATCH 1/7] MAINTAINERS: Add missing maintainer entry for AD8366 driver Rodrigo Alencar via B4 Relay
2026-01-19 14:36 ` [PATCH 2/7] dt-bindings: iio: amplifiers: Add AD8366 support Rodrigo Alencar via B4 Relay
2026-01-21 8:10 ` Krzysztof Kozlowski
2026-01-19 14:36 ` [PATCH 3/7] iio: amplifiers: ad8366: consume enable gpio for applicable parts Rodrigo Alencar via B4 Relay
2026-01-23 8:26 ` Jonathan Cameron
2026-01-19 14:36 ` [PATCH 4/7] iio: amplifiers: ad8366: Update device support Rodrigo Alencar via B4 Relay
2026-01-23 8:33 ` Jonathan Cameron
2026-01-23 8:38 ` Jonathan Cameron
2026-01-19 14:36 ` [PATCH 5/7] iio: amplifiers: ad8366: use cleanup.h mutex guard Rodrigo Alencar via B4 Relay
2026-01-19 14:43 ` Krzysztof Kozlowski
2026-01-23 8:36 ` Jonathan Cameron
2026-01-19 14:37 ` [PATCH 6/7] iio: amplifiers: ad8366: simplify resource management Rodrigo Alencar via B4 Relay
2026-01-19 14:45 ` Krzysztof Kozlowski
2026-01-19 14:37 ` [PATCH 7/7] iio: amplifiers: ad8366: add device tree support Rodrigo Alencar via B4 Relay
2026-01-19 14:47 ` Krzysztof Kozlowski
2026-01-23 8:42 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260123084210.7ef1684c@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rodrigo.alencar@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®