staging: iio: ad7606: rework regulator handling
authorEva Rachel Retuya <eraretuya@gmail.com>
Thu, 20 Oct 2016 13:08:23 +0000 (21:08 +0800)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:19 +0000 (19:34 +0100)
commitf0879217a8710289f3a9bac9e5db8f73e8189750
tree83a84cf1602dac5edecaddb7cae3b71d6f83fbf1
parent12edb97471fd4877bc0e527a42e0cbf8ab3937a5
staging: iio: ad7606: rework regulator handling

Currently, this driver ignores all errors from regulator_get(). The way
it is now, it also breaks probe deferral (EPROBE_DEFER). The correct
behavior is to propagate the error to the upper layers so they can
handle it accordingly.

Rework the regulator handling so that it matches the standard behavior.
If the specific design uses a static always-on regulator and does not
explicitly specify it, regulator_get() will return the dummy regulator.

Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7606.c