iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 2 Oct 2022 14:41:33 +0000 (15:41 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 29 Oct 2022 11:24:40 +0000 (12:24 +0100)
commit57572cacd36e6d4be7722d7770d23f4430219827
tree10ea3ef860c5e14d3c1793bbf767c37102033db0
parent207777dc306a732cff76ab63bf19a7e0851410b3
iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID.

The regulator enables were after the check on the chip variant, which was
very unlikely to return a correct value when not powered.
Presumably all the device anyone is testing on have a regulator that
is already powered up when this code runs for reasons beyond the scope
of this driver. Move the read call down a few lines.

Fixes: 3cf7ded15e40 ("iio: accel: bma400: basic regulator support")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dan Robertson <dan@dlrobertson.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221002144133.3771029-1-jic23@kernel.org
drivers/iio/accel/bma400_core.c