Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adi: ad7192: Add error check and more debug log

Print read and expected device ID as debug warning.
Add error check for ad_sd_init() result.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Markus Burri <markus.burri@mt.com>
Link: https://lore.kernel.org/r/20230614073033.2497318-1-markus.burri@mt.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Markus Burri and committed by
Jonathan Cameron
f41f4443 478baae9

+5 -3
+5 -3
drivers/iio/adc/ad7192.c
··· 402 402 id &= AD7192_ID_MASK; 403 403 404 404 if (id != st->chip_info->chip_id) 405 - dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", 406 - id); 405 + dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X != 0x%X)\n", 406 + id, st->chip_info->chip_id); 407 407 408 408 st->mode = AD7192_MODE_SEL(AD7192_MODE_IDLE) | 409 409 AD7192_MODE_CLKSRC(st->clock_sel) | ··· 1031 1031 else 1032 1032 indio_dev->info = &ad7192_info; 1033 1033 1034 - ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info); 1034 + ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info); 1035 + if (ret) 1036 + return ret; 1035 1037 1036 1038 ret = devm_ad_sd_setup_buffer_and_trigger(&spi->dev, indio_dev); 1037 1039 if (ret)