mbox series

[0/2] iio: adc: ad7313: fix non-const info struct

Message ID 20241122-iio-adc-ad7313-fix-non-const-info-struct-v1-0-d05c02324b73@baylibre.com (mailing list archive)
Headers show
Series iio: adc: ad7313: fix non-const info struct | expand

Message

David Lechner Nov. 22, 2024, 5:39 p.m. UTC
While working ad7124, Uwe pointed out a bug in the ad7313 driver.
static struct ad_sigma_delta_info ad7173_sigma_delta_info was not const
and was being modified during driver probe, which could lead to race
conditions if two instances of the driver were probed at the same time.

I've made an attempt to fix it, but it isn't exactly trivial and I have
only compile tested it. Guillaume has access to ad4111 hardware, so it
would be good to get a Tested-by from him to make sure this doesn't
break anything.

Reported-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
David Lechner (2):
      iio: adc: ad7313: fix irq number stored in static info struct
      iio: adc: ad7173: make struct ad_sigma_delta_info ad7173_sigma_delta_info const

 drivers/iio/adc/ad7173.c               | 476 +++++++++++++++++----------------
 drivers/iio/adc/ad_sigma_delta.c       |  14 +-
 include/linux/iio/adc/ad_sigma_delta.h |   5 +-
 3 files changed, 264 insertions(+), 231 deletions(-)
---
base-commit: 9dd2270ca0b38ee16094817f4a53e7ba78e31567
change-id: 20241122-iio-adc-ad7313-fix-non-const-info-struct-92e59b91ee2e

Best regards,