diff --git a/[refs] b/[refs] index 558bfa1bee96..94ac6b8cfb59 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f8a9f757cb425c4784b80b001c7a77c7810b499f +refs/heads/master: 216f2b9c95ac6e4f00b08df807bc4454434a9afb diff --git a/trunk/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/trunk/Documentation/devicetree/bindings/regulator/gpio-regulator.txt index f71f8083c2ae..63c659800c03 100644 --- a/trunk/Documentation/devicetree/bindings/regulator/gpio-regulator.txt +++ b/trunk/Documentation/devicetree/bindings/regulator/gpio-regulator.txt @@ -2,11 +2,12 @@ GPIO controlled regulators Required properties: - compatible : Must be "regulator-gpio". +- states : Selection of available voltages and GPIO configs. + if there are no states, then use a fixed regulator Optional properties: - enable-gpio : GPIO to use to enable/disable the regulator. - gpios : GPIO group used to control voltage. -- states : Selection of available voltages and GPIO configs. - startup-delay-us : Startup time in microseconds. - enable-active-high : Polarity of GPIO is active high (default is low). diff --git a/trunk/drivers/regulator/gpio-regulator.c b/trunk/drivers/regulator/gpio-regulator.c index faa2f712eb0d..dc9260545b80 100644 --- a/trunk/drivers/regulator/gpio-regulator.c +++ b/trunk/drivers/regulator/gpio-regulator.c @@ -183,6 +183,11 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) /* Fetch states. */ prop = of_find_property(np, "states", NULL); + if (!prop) { + dev_err(dev, "No 'states' property found\n"); + return ERR_PTR(-EINVAL); + } + proplen = prop->length / sizeof(int); config->states = devm_kzalloc(dev,