Commit 2903a2f2 authored by Chen Ni's avatar Chen Ni Committed by Jonathan Cameron
Browse files

iio: dac: ti-dac7311: Add check for spi_setup



Add check for the return value of spi_setup() and return the error
if it fails in order to catch the error.

Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240705084250.3006527-1-nichen@iscas.ac.cn


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2956979d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -249,7 +249,9 @@ static int ti_dac_probe(struct spi_device *spi)

	spi->mode = SPI_MODE_1;
	spi->bits_per_word = 16;
	spi_setup(spi);
	ret = spi_setup(spi);
	if (ret < 0)
		return dev_err_probe(dev, ret, "spi_setup failed\n");

	indio_dev->info = &ti_dac_info;
	indio_dev->name = spi_get_device_id(spi)->name;