]> git.baikalelectronics.ru Git - kernel.git/commit
iio: ad5064: Fix regulator handling
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 28 Sep 2018 09:23:40 +0000 (11:23 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 29 Sep 2018 12:28:47 +0000 (13:28 +0100)
commitaa80d1c89266604d44d17ee2c2091af0bdd0581b
tree6d3de9e207c9713fc8eb53dfd12b7a24de97dd78
parent67d9d73319698c791bccdc617c4a758f2b376c52
iio: ad5064: Fix regulator handling

The correct way to handle errors returned by regualtor_get() and friends is
to propagate the error since that means that an regulator was specified,
but something went wrong when requesting it.

For handling optional regulators, e.g. when the device has an internal
vref, regulator_get_optional() should be used to avoid getting the dummy
regulator that the regulator core otherwise provides.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5064.c