Skip to content

Commit

Permalink
Merge remote-tracking branch 'regulator/topic/gpio' into regulator-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Feb 19, 2013
2 parents eb230d4 + 896b65f commit a4dba88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3233,7 +3233,7 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
if (status < 0)
return status;
}
if (ops->is_enabled) {
if (rdev->ena_gpio || ops->is_enabled) {
status = device_create_file(dev, &dev_attr_state);
if (status < 0)
return status;
Expand Down
7 changes: 2 additions & 5 deletions drivers/regulator/gpio-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static struct regulator_ops gpio_regulator_voltage_ops = {
.list_voltage = gpio_regulator_list_voltage,
};

struct gpio_regulator_config *
static struct gpio_regulator_config *
of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
{
struct gpio_regulator_config *config;
Expand Down Expand Up @@ -163,10 +163,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);

/* Fetch GPIOs. */
for (i = 0; ; i++)
if (of_get_named_gpio(np, "gpios", i) < 0)
break;
config->nr_gpios = i;
config->nr_gpios = of_gpio_count(np);

config->gpios = devm_kzalloc(dev,
sizeof(struct gpio) * config->nr_gpios,
Expand Down

0 comments on commit a4dba88

Please sign in to comment.