]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ti-ads7950: simplify check for spi_setup() failures
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 6 Apr 2026 04:39:24 +0000 (21:39 -0700)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:17 +0000 (09:58 +0100)
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>
drivers/iio/adc/ti-ads7950.c

index 6e9ea9cc33bff00c5989098e777517d068a4959d..c31c706c92a983450ff7d3ad6903a266b66aa184 100644 (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;
        }