staging:iio:adc:ad7280a: Fix handing of device address bit reversing.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 6 Feb 2022 19:03:09 +0000 (19:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:24 +0000 (14:40 +0200)
commitb5db33a81ee7acf557dabf03ada137e6e5d5a278
treec1e4bec8585d6920f19aeee303a9a0eb1f5173bc
parentf5b01abf5f6529936d2c7932f8567100faaae635
staging:iio:adc:ad7280a: Fix handing of device address bit reversing.

[ Upstream commit f281e4ddbbc0b60f061bc18a2834e9363ba85f9f ]

The bit reversal was wrong for bits 1 and 3 of the 5 bits.
Result is driver failure to probe if you have more than 2 daisy-chained
devices.  Discovered via QEMU based device emulation.

Fixes tag is for when this moved from a macro to a function, but it
was broken before that.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 065a7c0b1fec ("Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse")
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-2-jic23@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/iio/adc/ad7280a.c