]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/slg51000-regulator.c
Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / regulator / slg51000-regulator.c
index a0565daecacef3bbf9971f23286e7f0151bea89a..bf1a3508ebc4038caa8a15f816261e4bd8ed02dd 100644 (file)
@@ -198,17 +198,14 @@ static int slg51000_of_parse_cb(struct device_node *np,
                                const struct regulator_desc *desc,
                                struct regulator_config *config)
 {
-       struct slg51000 *chip = config->driver_data;
        struct gpio_desc *ena_gpiod;
-       enum gpiod_flags gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-       ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
-                                               "enable-gpios", 0,
-                                               gflags, "gpio-en-ldo");
-       if (!IS_ERR(ena_gpiod)) {
+       ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
+                                          GPIOD_OUT_LOW |
+                                               GPIOD_FLAGS_BIT_NONEXCLUSIVE,
+                                          "gpio-en-ldo");
+       if (!IS_ERR(ena_gpiod))
                config->ena_gpiod = ena_gpiod;
-               devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
-       }
 
        return 0;
 }