]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: core: use regulator_ena_pin member
authorKim, Milo <Milo.Kim@ti.com>
Mon, 18 Feb 2013 06:50:55 +0000 (06:50 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 4 Mar 2013 02:37:57 +0000 (10:37 +0800)
 The regulator_dev has regulator_enable_gpio structure.
 'ena_gpio' and 'ena_gpio_invert' were moved to in regulator_enable_gpio.

  regulator_dev   --->   regulator_enable_gpio
  .ena_gpio              .gpio
  .ena_gpio_invert       .ena_gpio_invert

  Pointer, 'ena_pin' is used for checking valid enable GPIO pin.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c
include/linux/regulator/driver.h

index 57d434d3145a768e1daf5245b30c34de4649e79e..6c8c82406cd9b5e3a8a77e90168953c6e64d7080 100644 (file)
@@ -1945,7 +1945,7 @@ EXPORT_SYMBOL_GPL(regulator_disable_regmap);
 static int _regulator_is_enabled(struct regulator_dev *rdev)
 {
        /* A GPIO control always takes precedence */
-       if (rdev->ena_gpio)
+       if (rdev->ena_pin)
                return rdev->ena_gpio_state;
 
        /* If we don't know then assume that the regulator is always on */
@@ -3344,7 +3344,7 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
                if (status < 0)
                        return status;
        }
-       if (rdev->ena_gpio || ops->is_enabled) {
+       if (rdev->ena_pin || ops->is_enabled) {
                status = device_create_file(dev, &dev_attr_state);
                if (status < 0)
                        return status;
@@ -3556,7 +3556,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
                if (config->ena_gpio_flags & GPIOF_OUT_INIT_HIGH)
                        rdev->ena_gpio_state = 1;
 
-               if (rdev->ena_gpio_invert)
+               if (config->ena_gpio_invert)
                        rdev->ena_gpio_state = !rdev->ena_gpio_state;
        }
 
index a467d11dd67d51e3495167b6b4543c558fe149c7..7b7aeec04f869aea735163145ac99519b341a5ae 100644 (file)
@@ -302,8 +302,6 @@ struct regulator_dev {
        struct dentry *debugfs;
 
        struct regulator_enable_gpio *ena_pin;
-       int ena_gpio;
-       unsigned int ena_gpio_invert:1;
        unsigned int ena_gpio_state:1;
 };