]> Pileus Git - ~andy/linux/blobdiff - drivers/regulator/gpio-regulator.c
Merge remote-tracking branches 'regulator/topic/db8500', 'regulator/topic/gpio',...
[~andy/linux] / drivers / regulator / gpio-regulator.c
index 234960dc96077389460632cdc832f0c6ea5e69e1..c0a1d00b78c932a6982961334f9e3e9501592c50 100644 (file)
@@ -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", &regtype);
-       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;
 }