regulator: arizona-ldo1: Fix handling of GPIO 0
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thu, 15 Oct 2015 09:37:12 +0000 (10:37 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 16 Oct 2015 14:48:39 +0000 (15:48 +0100)
commitce938001c08c6580a8da38dc226fa605512afab6
treee20a0c631e76a048767463dbba290b629235d4aa
parent33aa380006776850872914d83fe0dbeee42fc95d
regulator: arizona-ldo1: Fix handling of GPIO 0

The LDO1 driver is using the arizona_of_get_named_gpio helper function
which will return 0 if an error was encountered whilst parsing the GPIO,
as under the pdata scheme 0 was not being treated as a valid GPIO.
However, since the regulator framework was expanded to allow the use of
GPIO 0 this causes us to attempt to register GPIO 0 when we encountered
an error parsing the device tree.

This patch uses of_get_named_gpio directly and sets the
ena_gpio_initialized flag based on the return value.

Fixes: 1de3821ace82 ("regulator: Set ena_gpio_initialized in regulator drivers")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/arizona-ldo1.c