Markus Pargmann 76f439df50 regulator: Add ena_gpio_initialized to regulator_config
Most drivers do not set the ena_gpio field of struct regulator_config
before passing it to the regulator core. This is fine as long as the
gpio identifier that is passed is a positive integer. But the gpio
identifier 0 is also valid. So we are not able to decide wether we got a
real gpio identifier or not based on a 0 in ena_gpio.

To be able to decide if it is a valid gpio that got passed, this patch
adds a ena_gpio_initialized field that should be set if was initialized
with a correct value, either a gpio >= 0 or a negative error number. The
core then checks if ena_gpio or ena_gpio_initialized before handling it
as a gpio. This way we maintain backwards compatibility and fix the
behaviour for gpio number 0.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:23:45 +01:00
..
2014-10-11 11:34:07 -07:00
2014-10-15 07:23:49 +02:00
2014-10-08 17:37:16 -04:00
2014-10-10 22:07:55 -04:00
2014-09-22 16:48:47 +09:00
2014-10-15 07:23:49 +02:00
2014-10-10 16:40:14 -04:00
2014-10-07 21:29:18 -04:00
2014-10-15 06:58:16 +02:00
2014-10-11 06:47:50 -04:00
2014-10-11 20:29:01 -04:00
2014-10-08 17:37:16 -04:00
2014-10-15 07:23:49 +02:00
2014-10-10 16:40:14 -04:00
2014-10-11 20:29:01 -04:00