Merge tag 'staging-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / drivers / regulator / gpio-regulator.c
index 2cfd9d3079e80ede35a5c61ff8314b820e8e2800..bae681ccd3ea73a24c0c0d3f98a948d9a7fd06f1 100644 (file)
@@ -82,7 +82,7 @@ static int gpio_regulator_set_voltage(struct regulator_dev *dev,
 
        for (ptr = 0; ptr < data->nr_gpios; ptr++) {
                state = (target & (1 << ptr)) >> ptr;
-               gpio_set_value(data->gpios[ptr].gpio, state);
+               gpio_set_value_cansleep(data->gpios[ptr].gpio, state);
        }
        data->state = target;
 
@@ -119,7 +119,7 @@ static int gpio_regulator_set_current_limit(struct regulator_dev *dev,
 
        for (ptr = 0; ptr < data->nr_gpios; ptr++) {
                state = (target & (1 << ptr)) >> ptr;
-               gpio_set_value(data->gpios[ptr].gpio, state);
+               gpio_set_value_cansleep(data->gpios[ptr].gpio, state);
        }
        data->state = target;
 
@@ -174,7 +174,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
        if (!config->gpios)
                return ERR_PTR(-ENOMEM);
 
-       for (i = 0; config->nr_gpios; i++) {
+       for (i = 0; i < config->nr_gpios; i++) {
                gpio = of_get_named_gpio(np, "gpios", i);
                if (gpio < 0)
                        break;
@@ -365,7 +365,7 @@ static int gpio_regulator_remove(struct platform_device *pdev)
 }
 
 #if defined(CONFIG_OF)
-static const struct of_device_id regulator_gpio_of_match[] __devinitconst = {
+static const struct of_device_id regulator_gpio_of_match[] = {
        { .compatible = "regulator-gpio", },
        {},
 };