diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-24 15:02:48 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-24 15:02:48 +0100 |
commit | 3981560c2a8acae1a66cbf319f8ca1c92dde8f4d (patch) | |
tree | c05e2a5474c02813cc420cc2873a54109b3885e8 /drivers/regulator/gpio-regulator.c | |
parent | Merge remote-tracking branch 'regulator/fix/fixed' into regulator-linus (diff) | |
parent | regulator: gpio-regulator: Don't oops on missing regulator-type property (diff) | |
download | linux-3981560c2a8acae1a66cbf319f8ca1c92dde8f4d.tar.xz linux-3981560c2a8acae1a66cbf319f8ca1c92dde8f4d.zip |
Merge remote-tracking branch 'regulator/fix/gpio' into regulator-linus
Diffstat (limited to 'drivers/regulator/gpio-regulator.c')
-rw-r--r-- | drivers/regulator/gpio-regulator.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 04406a918c04..234960dc9607 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -139,6 +139,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) struct property *prop; const char *regtype; int proplen, gpio, i; + int ret; config = devm_kzalloc(dev, sizeof(struct gpio_regulator_config), @@ -202,7 +203,11 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) } config->nr_states = i; - of_property_read_string(np, "regulator-type", ®type); + ret = of_property_read_string(np, "regulator-type", ®type); + if (ret < 0) { + dev_err(dev, "Missing 'regulator-type' property\n"); + return ERR_PTR(-EINVAL); + } if (!strncmp("voltage", regtype, 7)) config->type = REGULATOR_VOLTAGE; |