summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorChiYuan Huang <cy_huang@richtek.com>2022-06-29 04:41:00 +0300
committerMark Brown <broonie@kernel.org>2022-06-29 18:31:41 +0300
commit4806c991bf4ff959acf921ea72f931a945a968ae (patch)
tree048ccc28dc3ba6efc1c5b5ca06c6f17f26ae13fe /drivers/regulator
parent0e584d46218e3b9dc12a98e18e81a0cd3e0d5419 (diff)
downloadlinux-4806c991bf4ff959acf921ea72f931a945a968ae.tar.xz
regulator: mt6370: Use 'fwnode_gpiod_get_index' to fix gpio parsing
From the common binding, 'enable-gpio' or 'enable-gpios' are all well for external 'enable' gpio. 'gpiod_get_from_of_node' only parse the 'enable' property, it need to add the gpio suffix. It's more convenient to use fwnode_gpiod_get_index. Although fwnode parsing is not preferred, but 'of_parse_cb' already can guarantee the callback will only be used by regulator of_node parsing. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1656466861-7737-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/mt6370-regulator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/mt6370-regulator.c b/drivers/regulator/mt6370-regulator.c
index bc356b4bbf22..949b2c7b5556 100644
--- a/drivers/regulator/mt6370-regulator.c
+++ b/drivers/regulator/mt6370-regulator.c
@@ -153,7 +153,8 @@ static int mt6370_of_parse_cb(struct device_node *np,
struct gpio_desc *enable_gpio;
int ret;
- enable_gpio = gpiod_get_from_of_node(np, "enable", 0, GPIOD_OUT_HIGH |
+ enable_gpio = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
+ GPIOD_OUT_HIGH |
GPIOD_FLAGS_BIT_NONEXCLUSIVE,
desc->name);
if (IS_ERR(enable_gpio)) {