Merge remote-tracking branches 'regulator/topic/db8500', 'regulator/topic/gpio', 'regulator/topic/lp3971', 'regulator/topic/lp3972', 'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/mc13892', 'regulator/topic/pcf50633' and 'regulator/topic/pfuze100' into regulator-linus
This commit is contained in:

@@ -203,17 +203,18 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
|
||||
}
|
||||
config->nr_states = i;
|
||||
|
||||
config->type = REGULATOR_VOLTAGE;
|
||||
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 (ret >= 0) {
|
||||
if (!strncmp("voltage", regtype, 7))
|
||||
config->type = REGULATOR_VOLTAGE;
|
||||
else if (!strncmp("current", regtype, 7))
|
||||
config->type = REGULATOR_CURRENT;
|
||||
else
|
||||
dev_warn(dev, "Unknown regulator-type '%s'\n",
|
||||
regtype);
|
||||
}
|
||||
|
||||
if (!strncmp("voltage", regtype, 7))
|
||||
config->type = REGULATOR_VOLTAGE;
|
||||
else if (!strncmp("current", regtype, 7))
|
||||
config->type = REGULATOR_CURRENT;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user