iio: adc: ti-ads7950: simplify check for spi_setup() failures

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>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Dmitry Torokhov 2026-04-05 21:39:24 -07:00 committed by Jonathan Cameron
parent 3bfc60fc10
commit 1c3b46b9de

View File

@ -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;
}