From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH v5 2/4] iio: adc: ti-ads7950: simplify check for spi_setup() failures
Date: Sun, 05 Apr 2026 21:39:24 -0700 [thread overview]
Message-ID: <20260405-ti-ads7950-facelift-v5-2-1f980ed3cf9e@gmail.com> (raw)
In-Reply-To: <20260405-ti-ads7950-facelift-v5-0-1f980ed3cf9e@gmail.com>
spi_setup() specifies that it returns 0 on success or negative error on
failure. Therefore we can simply check for the return code being 0 or
not.
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/iio/adc/ti-ads7950.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c
index 6e9ea9cc33bf..c31c706c92a9 100644
--- a/drivers/iio/adc/ti-ads7950.c
+++ b/drivers/iio/adc/ti-ads7950.c
@@ -520,7 +520,7 @@ static int ti_ads7950_probe(struct spi_device *spi)
spi->bits_per_word = 16;
spi->mode |= SPI_CS_WORD;
ret = spi_setup(spi);
- if (ret < 0) {
+ if (ret) {
dev_err(&spi->dev, "Error in spi setup\n");
return ret;
}
--
2.53.0.1213.gd9a14994de-goog
next prev parent reply other threads:[~2026-04-06 4:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 4:39 [PATCH v5 0/4] ti-ads7950: fix gpio handling and facelift Dmitry Torokhov
2026-04-06 4:39 ` [PATCH v5 1/4] iio: adc: ti-ads7950: switch to using guard() notation Dmitry Torokhov
2026-04-06 4:39 ` Dmitry Torokhov [this message]
2026-04-06 4:39 ` [PATCH v5 3/4] iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage() Dmitry Torokhov
2026-04-06 4:39 ` [PATCH v5 4/4] iio: adc: ti-ads7950: complete conversion to using managed resources Dmitry Torokhov
2026-04-07 10:43 ` Bartosz Golaszewski
2026-04-07 12:24 ` [PATCH v5 0/4] ti-ads7950: fix gpio handling and facelift Andy Shevchenko
2026-04-08 8:02 ` Linus Walleij
2026-04-11 21:39 ` David Lechner
2026-04-12 18:38 ` Jonathan Cameron
2026-05-05 0:25 ` Dmitry Torokhov
2026-05-05 9:26 ` Jonathan Cameron
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=20260405-ti-ads7950-facelift-v5-2-1f980ed3cf9e@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--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