]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:57:26 +0000 (19:57 -0600)
commit5e4c1c3e1add30a3b4d8d79f0cad97d1c3e8471f
tree076146316c6da63921806bd6cb77732f127a6c8c
parentb4e02aa5737433fe09fef6a913ad319afec21f79
iio: ad5064: Fix regulator handling

BugLink: https://bugs.launchpad.net/bugs/1836802
commit 8911a43bc198877fad9f4b0246a866b26bb547ab upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iio/dac/ad5064.c