[PATCH 01/12] iio: adc: rohm-bd79124: Fix rising alarm

Matti Vaittinen <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <b38dd82c759db17796054b6847fd7f770be27efd.1786347811.git.mazziesaccount@gmail.com>
From: Matti Vaittinen <[email protected]>

The rising alarm is using the cached falling alarm value causing wrong
value to be used.

Fix this by using the correct cached value for rising alarm.

Signed-off-by: Matti Vaittinen <[email protected]>
Fixes: 3f57a3b9ab74 ("iio: adc: Support ROHM BD79124 ADC")
---
 drivers/iio/adc/rohm-bd79124.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/rohm-bd79124.c b/drivers/iio/adc/rohm-bd79124.c
index 864f3b1366b5..f703c74309cc 100644
--- a/drivers/iio/adc/rohm-bd79124.c
+++ b/drivers/iio/adc/rohm-bd79124.c
@@ -525,7 +525,7 @@ static int bd79124_enable_event(struct bd79124_data *data,
 		return ret;
 
 	if (dir == IIO_EV_DIR_RISING) {
-		limit = &data->alarm_f_limit[channel];
+		limit = &data->alarm_r_limit[channel];
 		reg = BD79124_GET_HIGH_LIMIT_REG(channel);
 	} else {
 		limit = &data->alarm_f_limit[channel];
-- 
2.55.0
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5gqQACgkQeFA3/03a
ocXWVQf+NV25xXjCt2gTfw5t7SZ7bSgKn2rM+iSyqflAi6TaOuYJFZ7/tRzA7F57
lTzBRvHK7HjPZF/4MP+WC23xI8Q93H+SUsBBt8tEqzd0C4xALD6k7o2BLKy6evnV
EA8K1XtkZHxERKbrVXrf1VNnai1LND/NRnxmPL529JvwXqO2t1Z9OLH5XZpNQrVq
3cv/+QsaTkaK2cZ0DfVGPYZ8Joqdgay9obGiy+nKT3Ei+sBAyBxFObMrKlbvLrEv
mqvb9TTb0xJLHg2uCOs/sD2LGBP2cEm1jWZEcQJQiGOW199cB8po4QBPA/9AYmxH
tk1W3GBHuS9zkSwJqgalsCY6xFklQw==
=KtqD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.