From: David Lechner Date: Wed, 11 Jun 2025 14:40:16 +0000 (-0500) Subject: iio: adc: ad7173: check return value of spi_setup() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1763bd3a0c030284083c044900da1b185a91b27c;p=users%2Fhch%2Fmisc.git iio: adc: ad7173: check return value of spi_setup() Check the return value of spi_setup() and propagate the error in the ad7173_probe() function. This is unlikely to happen since virtually every SPI controller supports SPI_MODE_3, but still always a good idea to check the return value. Signed-off-by: David Lechner Link: https://patch.msgid.link/20250611-iio-adc-ad7173-check-spi_setup-return-v1-1-4d6f9ef0a2e4@baylibre.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c index b3e6bd2a55d7..d75adb88af20 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -1765,7 +1765,9 @@ static int ad7173_probe(struct spi_device *spi) indio_dev->info = &ad7173_info; spi->mode = SPI_MODE_3; - spi_setup(spi); + ret = spi_setup(spi); + if (ret) + return ret; ret = ad_sd_init(&st->sd, indio_dev, spi, st->info->sd_info); if (ret)