aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-11-24 09:02:48 -0500
committerMark Brown <broonie@linaro.org>2013-11-24 09:02:48 -0500
commit3981560c2a8acae1a66cbf319f8ca1c92dde8f4d (patch)
treec05e2a5474c02813cc420cc2873a54109b3885e8 /drivers/regulator
parent7e9e801f746cfc66c0666e6cffa7479eebeab171 (diff)
parent251b9c21d26ca9d210e7673f0819ee1f6c19402a (diff)
Merge remote-tracking branch 'regulator/fix/gpio' into regulator-linus
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/gpio-regulator.c7
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)
139 struct property *prop; 139 struct property *prop;
140 const char *regtype; 140 const char *regtype;
141 int proplen, gpio, i; 141 int proplen, gpio, i;
142 int ret;
142 143
143 config = devm_kzalloc(dev, 144 config = devm_kzalloc(dev,
144 sizeof(struct gpio_regulator_config), 145 sizeof(struct gpio_regulator_config),
@@ -202,7 +203,11 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
202 } 203 }
203 config->nr_states = i; 204 config->nr_states = i;
204 205
205 of_property_read_string(np, "regulator-type", &regtype); 206 ret = of_property_read_string(np, "regulator-type", &regtype);
207 if (ret < 0) {
208 dev_err(dev, "Missing 'regulator-type' property\n");
209 return ERR_PTR(-EINVAL);
210 }
206 211
207 if (!strncmp("voltage", regtype, 7)) 212 if (!strncmp("voltage", regtype, 7))
208 config->type = REGULATOR_VOLTAGE; 213 config->type = REGULATOR_VOLTAGE;