From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7944: Consolidate spi_sync() wrapper
Date: Sat, 13 Apr 2024 12:05:07 +0100 [thread overview]
Message-ID: <20240413120507.05bbd229@jic23-huawei> (raw)
In-Reply-To: <20240412-ad7944-consolidate-msg-v1-1-7fdeff89172f@baylibre.com>
On Fri, 12 Apr 2024 18:25:02 -0500
David Lechner <dlechner@baylibre.com> wrote:
> Since commit 6020ca4de8e5 ("iio: adc: ad7944: use spi_optimize_message()"),
> The helper functions wrapping spi_sync() for 3-wire and 4-wire modes are
> virtually identical. Since gpiod_set_value_cansleep() does a NULL check
> internally, we can consolidate the two functions into one and avoid
> switch statements at the call sites.
>
> The default cases of the removed switch statement were just to make the
> compiler happy and are not reachable since the mode is validated in the
> probe function. So removing those should be safe.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
I was initially dubious about implying the need to change a GPIO when we don't,
but given that the resulting function is really simple and the comment on that
is immediately above the code (not obvious from this diff) this seems fine to
me.
Applied.
prev parent reply other threads:[~2024-04-13 11:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 23:25 [PATCH] iio: adc: ad7944: Consolidate spi_sync() wrapper David Lechner
2024-04-13 11:05 ` 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=20240413120507.05bbd229@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@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