mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
3bfc60fc10
commit
1c3b46b9de
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user