diff options
Diffstat (limited to 'drivers/regulator/slg51000-regulator.c')
-rw-r--r-- | drivers/regulator/slg51000-regulator.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c index a0565daecace..bf1a3508ebc4 100644 --- a/drivers/regulator/slg51000-regulator.c +++ b/drivers/regulator/slg51000-regulator.c @@ -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; } |