iio: adc: ad7887: invert/rework external ref logic
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Fri, 2 Oct 2020 08:27:23 +0000 (11:27 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 10 Oct 2020 16:38:36 +0000 (17:38 +0100)
commit5483b8d5015bb366c372870cfe4448742082e41f
tree047a17417b07aada3bc6c7b4b14f7e4fd64aac8d
parentead1c9f376dbb2805796098ed6d2a70921c77ee5
iio: adc: ad7887: invert/rework external ref logic

This change inverts/reworks the logic to use an external reference via a
provided regulator.

Now the driver tries to obtain a regulator. If one is found, then it is
used. The rest of the driver logic already checks if there is a non-NULL
reference to a regulator, so it should be fine.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201002082723.184810-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7887.c
include/linux/platform_data/ad7887.h