linux-next: manual merge of the iio tree with the iio-fixes tree
Hi all,
Today's linux-next merge of the iio tree got a conflict in:
drivers/iio/adc/ad7606.c
between commit:
3f5fd1717ae9 ("iio: adc: ad7606: fix raw read for 18-bit chips")
from the iio-fixes tree and commit:
3b5b55ca9407 ("iio: adc: ad7606: dynamically allocate channel info")
from the iio tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 38 lines
Cheers,
Stephen Rothwell
diff --cc drivers/iio/adc/ad7606.c
index 8ed65a35b486,aa96247d6757..000000000000
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@@ -726,17 -657,20 +657,18 @@@ static int ad7606_scan_direct(struct ii
if (ret)
goto error_ret;
- chan = &indio_dev->channels[ch + 1];
+ chan = &indio_dev->channels[ch];
+ realbits = chan->scan_type.realbits;
- if (chan->scan_type.sign == 'u') {
- if (realbits > 16)
- *val = st->data.buf32[ch];
- else
- *val = st->data.buf16[ch];
- } else {
- if (realbits > 16)
- *val = sign_extend32(st->data.buf32[ch], realbits - 1);
- else
- *val = sign_extend32(st->data.buf16[ch], realbits - 1);
- }
+ if (realbits > 16)
+ *val = st->data.buf32[ch];
+ else
+ *val = st->data.buf16[ch];
+
+ *val &= GENMASK(realbits - 1, 0);
+
+ if (chan->scan_type.sign == 's')
+ *val = sign_extend32(*val, realbits - 1);
error_ret:
if (!st->gpio_convst) {