diff options
| author | Chen Ni <nichen@iscas.ac.cn> | 2024-07-05 11:42:50 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-07-29 22:31:13 +0300 |
| commit | 2903a2f260039a851ba60bdb88c09aa6d4eafd80 (patch) | |
| tree | a151537b7a685bb5bec456884286624675efcb34 | |
| parent | 2956979dbd0d47473b41129d8fc8127ed13fd687 (diff) | |
| download | linux-2903a2f260039a851ba60bdb88c09aa6d4eafd80.tar.xz | |
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: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240705084250.3006527-1-nichen@iscas.ac.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| -rw-r--r-- | drivers/iio/dac/ti-dac7311.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/dac/ti-dac7311.c b/drivers/iio/dac/ti-dac7311.c index 7f89d2a52f49..6f4aa4794a0c 100644 --- a/drivers/iio/dac/ti-dac7311.c +++ b/drivers/iio/dac/ti-dac7311.c @@ -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; |
