linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index
@ 2019-10-04 23:10 Dmitry Torokhov
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linus Walleij, linux-kernel, Bartlomiej Zolnierkiewicz,
	Chanwoo Choi, Krzysztof Kozlowski, Liam Girdwood, Sangbeom Kim,
	Support Opensource, linux-samsung-soc

This series swiches regulator drivers form using
[devm_]gpiod_get_from_of_node() that is scheduled to be removed in favor
of [devm_]fwnode_gpiod_get_index() that behaves more like standard
[devm_]gpiod_get_index() and will potentially handle secondary software
nodes in cases we need to augment platform firmware.

This depends on the new code that can be found in
ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

	git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

I hope that it would be possible to pull in this immutable branch and
not wait until after 5.5 merge window.

Thanks!

Dmitry Torokhov (7):
  regulator: s5m8767: switch to using devm_fwnode_gpiod_get
  regulator: slg51000: switch to using fwnode_gpiod_get_index
  regulator: tps65090: switch to using devm_fwnode_gpiod_get
  regulator: s2mps11: switch to using devm_fwnode_gpiod_get
  regulator: da9211: switch to using devm_fwnode_gpiod_get
  regulator: tps65132: switch to using devm_fwnode_gpiod_get()
  regulator: max77686: switch to using fwnode_gpiod_get_index

 drivers/regulator/da9211-regulator.c   | 12 ++++++------
 drivers/regulator/max77686-regulator.c |  5 +++--
 drivers/regulator/s2mps11.c            |  7 +++----
 drivers/regulator/s5m8767.c            |  7 +++----
 drivers/regulator/slg51000-regulator.c | 13 +++++--------
 drivers/regulator/tps65090-regulator.c | 26 +++++++++++++++-----------
 drivers/regulator/tps65132-regulator.c | 17 ++++++++++-------
 7 files changed, 45 insertions(+), 42 deletions(-)

-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-05  6:42   ` kbuild test robot
                     ` (2 more replies)
  2019-10-04 23:10 ` [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index Dmitry Torokhov
                   ` (6 subsequent siblings)
  7 siblings, 3 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linus Walleij, linux-kernel, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Liam Girdwood, Sangbeom Kim,
	linux-samsung-soc

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/s5m8767.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 6ca27e9d5ef7..bdc07739e9a2 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -567,11 +567,10 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 			continue;
 		}
 
-		rdata->ext_control_gpiod = devm_gpiod_get_from_of_node(
+		rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
 			&pdev->dev,
-			reg_np,
-			"s5m8767,pmic-ext-control-gpios",
-			0,
+			of_fwnode_handle(reg_np),
+			"s5m8767,pmic-ext-control",
 			GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 			"s5m8767");
 		if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-05  5:36   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: slg51000: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
  2019-10-04 23:10 ` [PATCH 3/7] regulator: tps65090: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linus Walleij, linux-kernel, Liam Girdwood, Support Opensource

devm_gpiod_get_from_of_node() is being retired in favor of
[devm_]fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Note that now that we have a good non-devm API for getting GPIO from
arbitrary firmware node, there is no reason to use devm API here as
regulator core takes care of managing lifetime of "enable" GPIO and we
were immediately detaching requested GPIO from devm anyway.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/slg51000-regulator.c | 13 +++++--------
 1 file 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;
 }
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/7] regulator: tps65090: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
  2019-10-04 23:10 ` [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-07 13:03   ` Applied "regulator: tps65090: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2019-10-04 23:10 ` [PATCH 4/7] regulator: s2mps11: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linus Walleij, linux-kernel, Liam Girdwood

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/tps65090-regulator.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 10ea4b5a0f55..f0b660e9f15f 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -346,16 +346,20 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 	for (idx = 0; idx < ARRAY_SIZE(tps65090_matches); idx++) {
 		struct regulator_init_data *ri_data;
 		struct tps65090_regulator_plat_data *rpdata;
+		struct device_node *np;
 
 		rpdata = &reg_pdata[idx];
 		ri_data = tps65090_matches[idx].init_data;
-		if (!ri_data || !tps65090_matches[idx].of_node)
+		if (!ri_data)
+			continue;
+
+		np = tps65090_matches[idx].of_node;
+		if (!np)
 			continue;
 
 		rpdata->reg_init_data = ri_data;
-		rpdata->enable_ext_control = of_property_read_bool(
-					tps65090_matches[idx].of_node,
-					"ti,enable-ext-control");
+		rpdata->enable_ext_control = of_property_read_bool(np,
+						"ti,enable-ext-control");
 		if (rpdata->enable_ext_control) {
 			enum gpiod_flags gflags;
 
@@ -366,11 +370,12 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 				gflags = GPIOD_OUT_LOW;
 			gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-			rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev,
-								    tps65090_matches[idx].of_node,
-								    "dcdc-ext-control-gpios", 0,
-								    gflags,
-								    "tps65090");
+			rpdata->gpiod = devm_fwnode_gpiod_get(
+							&pdev->dev,
+							of_fwnode_handle(np),
+							"dcdc-ext-control",
+							gflags,
+							"tps65090");
 			if (PTR_ERR(rpdata->gpiod) == -ENOENT) {
 				dev_err(&pdev->dev,
 					"could not find DCDC external control GPIO\n");
@@ -379,8 +384,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 				return ERR_CAST(rpdata->gpiod);
 		}
 
-		if (of_property_read_u32(tps65090_matches[idx].of_node,
-					 "ti,overcurrent-wait",
+		if (of_property_read_u32(np, "ti,overcurrent-wait",
 					 &rpdata->overcurrent_wait) == 0)
 			rpdata->overcurrent_wait_valid = true;
 
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/7] regulator: s2mps11: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
                   ` (2 preceding siblings ...)
  2019-10-04 23:10 ` [PATCH 3/7] regulator: tps65090: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-07 13:03   ` Applied "regulator: s2mps11: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linus Walleij, linux-kernel, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Liam Girdwood, Sangbeom Kim,
	linux-samsung-soc

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/s2mps11.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 5bc00884cf51..4f2dc5ebffdc 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -844,10 +844,9 @@ static void s2mps14_pmic_dt_parse_ext_control_gpio(struct platform_device *pdev,
 		if (!rdata[reg].init_data || !rdata[reg].of_node)
 			continue;
 
-		gpio[reg] = devm_gpiod_get_from_of_node(&pdev->dev,
-				rdata[reg].of_node,
-				"samsung,ext-control-gpios",
-				0,
+		gpio[reg] = devm_fwnode_gpiod_get(&pdev->dev,
+				of_fwnode_handle(rdata[reg].of_node),
+				"samsung,ext-control",
 				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 				"s2mps11-regulator");
 		if (PTR_ERR(gpio[reg]) == -ENOENT)
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
                   ` (3 preceding siblings ...)
  2019-10-04 23:10 ` [PATCH 4/7] regulator: s2mps11: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-05  6:12   ` kbuild test robot
                     ` (2 more replies)
  2019-10-04 23:10 ` [PATCH 6/7] regulator: tps65132: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
                   ` (2 subsequent siblings)
  7 siblings, 3 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linus Walleij, linux-kernel, Liam Girdwood, Support Opensource

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/da9211-regulator.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c
index bf80748f1ccc..523dc1b95826 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -283,12 +283,12 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
 
 		pdata->init_data[n] = da9211_matches[i].init_data;
 		pdata->reg_node[n] = da9211_matches[i].of_node;
-		pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev,
-				  da9211_matches[i].of_node,
-				  "enable-gpios",
-				  0,
-				  GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
-				  "da9211-enable");
+		pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
+					of_fwnode_handle(pdata->reg_node[n]),
+					"enable",
+					GPIOD_OUT_HIGH |
+						GPIOD_FLAGS_BIT_NONEXCLUSIVE,
+					"da9211-enable");
 		if (IS_ERR(pdata->gpiod_ren[n]))
 			pdata->gpiod_ren[n] = NULL;
 		n++;
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/7] regulator: tps65132: switch to using devm_fwnode_gpiod_get()
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
                   ` (4 preceding siblings ...)
  2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-07 13:03   ` Applied "regulator: tps65132: switch to using devm_fwnode_gpiod_get()" to the regulator tree Mark Brown
  2019-10-04 23:10 ` [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index Dmitry Torokhov
  2019-10-05 19:01 ` [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Linus Walleij
  7 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linus Walleij, linux-kernel, Liam Girdwood

devm_fwnode_get_index_gpiod_from_child() is going away as the name is
too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Note that we no longer need to check for NULL as devm_fwnode_gpiod_get()
will return -ENOENT if GPIO is missing.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

 drivers/regulator/tps65132-regulator.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/tps65132-regulator.c b/drivers/regulator/tps65132-regulator.c
index e302bd01a084..7b0e38f8d627 100644
--- a/drivers/regulator/tps65132-regulator.c
+++ b/drivers/regulator/tps65132-regulator.c
@@ -136,9 +136,10 @@ static int tps65132_of_parse_cb(struct device_node *np,
 	struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[desc->id];
 	int ret;
 
-	rpdata->en_gpiod = devm_fwnode_get_index_gpiod_from_child(tps->dev,
-					"enable", 0, &np->fwnode, 0, "enable");
-	if (IS_ERR_OR_NULL(rpdata->en_gpiod)) {
+	rpdata->en_gpiod = devm_fwnode_gpiod_get(tps->dev, of_fwnode_handle(np),
+						 "enable", GPIOD_ASIS,
+						 "enable");
+	if (IS_ERR(rpdata->en_gpiod)) {
 		ret = PTR_ERR(rpdata->en_gpiod);
 
 		/* Ignore the error other than probe defer */
@@ -147,10 +148,12 @@ static int tps65132_of_parse_cb(struct device_node *np,
 		return 0;
 	}
 
-	rpdata->act_dis_gpiod = devm_fwnode_get_index_gpiod_from_child(
-					tps->dev, "active-discharge", 0,
-					&np->fwnode, 0, "active-discharge");
-	if (IS_ERR_OR_NULL(rpdata->act_dis_gpiod)) {
+	rpdata->act_dis_gpiod = devm_fwnode_gpiod_get(tps->dev,
+						      of_fwnode_handle(np),
+						      "active-discharge",
+						      GPIOD_ASIS,
+						      "active-discharge");
+	if (IS_ERR(rpdata->act_dis_gpiod)) {
 		ret = PTR_ERR(rpdata->act_dis_gpiod);
 
 		/* Ignore the error other than probe defer */
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
                   ` (5 preceding siblings ...)
  2019-10-04 23:10 ` [PATCH 6/7] regulator: tps65132: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
@ 2019-10-04 23:10 ` Dmitry Torokhov
  2019-10-05  7:26   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: max77686: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
  2019-10-05 19:01 ` [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Linus Walleij
  7 siblings, 2 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-04 23:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linus Walleij, linux-kernel, Bartlomiej Zolnierkiewicz,
	Chanwoo Choi, Krzysztof Kozlowski, Liam Girdwood

gpiod_get_from_of_node() is being retired in favor of
fwnode_gpiod_get_index(), that behaves similar to gpiod_get_index(),
but can work with arbitrary firmware node. It will also be able to
support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

---

 drivers/regulator/max77686-regulator.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/max77686-regulator.c b/drivers/regulator/max77686-regulator.c
index c8e579e99316..9089ec608fcc 100644
--- a/drivers/regulator/max77686-regulator.c
+++ b/drivers/regulator/max77686-regulator.c
@@ -256,8 +256,9 @@ static int max77686_of_parse_cb(struct device_node *np,
 	case MAX77686_BUCK8:
 	case MAX77686_BUCK9:
 	case MAX77686_LDO20 ... MAX77686_LDO22:
-		config->ena_gpiod = gpiod_get_from_of_node(np,
-				"maxim,ena-gpios",
+		config->ena_gpiod = fwnode_gpiod_get_index(
+				of_fwnode_handle(np),
+				"maxim,ena",
 				0,
 				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 				"max77686-regulator");
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index
  2019-10-04 23:10 ` [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index Dmitry Torokhov
@ 2019-10-05  5:36   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: slg51000: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
  1 sibling, 0 replies; 22+ messages in thread
From: kbuild test robot @ 2019-10-05  5:36 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Mark Brown, Linus Walleij, linux-kernel,
	Liam Girdwood, Support Opensource

[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/regulator/slg51000-regulator.c: In function 'slg51000_of_parse_cb':
>> drivers/regulator/slg51000-regulator.c:203:14: error: implicit declaration of function 'fwnode_gpiod_get_index'; did you mean 'devm_gpiod_get_index'? [-Werror=implicit-function-declaration]
     ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
                 ^~~~~~~~~~~~~~~~~~~~~~
                 devm_gpiod_get_index
>> drivers/regulator/slg51000-regulator.c:203:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
               ^
   cc1: some warnings being treated as errors

vim +203 drivers/regulator/slg51000-regulator.c

   196	
   197	static int slg51000_of_parse_cb(struct device_node *np,
   198					const struct regulator_desc *desc,
   199					struct regulator_config *config)
   200	{
   201		struct gpio_desc *ena_gpiod;
   202	
 > 203		ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
   204						   GPIOD_OUT_LOW |
   205							GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   206						   "gpio-en-ldo");
   207		if (!IS_ERR(ena_gpiod))
   208			config->ena_gpiod = ena_gpiod;
   209	
   210		return 0;
   211	}
   212	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52234 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-05  6:12   ` kbuild test robot
  2019-10-07 10:43   ` Adam Thomson
  2019-10-07 13:03   ` Applied "regulator: da9211: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: kbuild test robot @ 2019-10-05  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Mark Brown, Linus Walleij, linux-kernel,
	Liam Girdwood, Support Opensource

[-- Attachment #1: Type: text/plain, Size: 3808 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/regulator/da9211-regulator.c: In function 'da9211_parse_regulators_dt':
>> drivers/regulator/da9211-regulator.c:286:25: error: implicit declaration of function 'devm_fwnode_gpiod_get'; did you mean 'devm_gpiod_get'? [-Werror=implicit-function-declaration]
      pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
                            ^~~~~~~~~~~~~~~~~~~~~
                            devm_gpiod_get
>> drivers/regulator/da9211-regulator.c:286:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
                          ^
   cc1: some warnings being treated as errors

vim +286 drivers/regulator/da9211-regulator.c

   245	
   246	#ifdef CONFIG_OF
   247	static struct of_regulator_match da9211_matches[] = {
   248		[DA9211_ID_BUCKA] = { .name = "BUCKA" },
   249		[DA9211_ID_BUCKB] = { .name = "BUCKB" },
   250		};
   251	
   252	static struct da9211_pdata *da9211_parse_regulators_dt(
   253			struct device *dev)
   254	{
   255		struct da9211_pdata *pdata;
   256		struct device_node *node;
   257		int i, num, n;
   258	
   259		node = of_get_child_by_name(dev->of_node, "regulators");
   260		if (!node) {
   261			dev_err(dev, "regulators node not found\n");
   262			return ERR_PTR(-ENODEV);
   263		}
   264	
   265		num = of_regulator_match(dev, node, da9211_matches,
   266					 ARRAY_SIZE(da9211_matches));
   267		of_node_put(node);
   268		if (num < 0) {
   269			dev_err(dev, "Failed to match regulators\n");
   270			return ERR_PTR(-EINVAL);
   271		}
   272	
   273		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
   274		if (!pdata)
   275			return ERR_PTR(-ENOMEM);
   276	
   277		pdata->num_buck = num;
   278	
   279		n = 0;
   280		for (i = 0; i < ARRAY_SIZE(da9211_matches); i++) {
   281			if (!da9211_matches[i].init_data)
   282				continue;
   283	
   284			pdata->init_data[n] = da9211_matches[i].init_data;
   285			pdata->reg_node[n] = da9211_matches[i].of_node;
 > 286			pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
   287						of_fwnode_handle(pdata->reg_node[n]),
   288						"enable",
   289						GPIOD_OUT_HIGH |
   290							GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   291						"da9211-enable");
   292			if (IS_ERR(pdata->gpiod_ren[n]))
   293				pdata->gpiod_ren[n] = NULL;
   294			n++;
   295		}
   296	
   297		return pdata;
   298	}
   299	#else
   300	static struct da9211_pdata *da9211_parse_regulators_dt(
   301			struct device *dev)
   302	{
   303		return ERR_PTR(-ENODEV);
   304	}
   305	#endif
   306	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52234 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-05  6:42   ` kbuild test robot
  2019-10-05  6:59   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: s5m8767: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: kbuild test robot @ 2019-10-05  6:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Mark Brown, Linus Walleij, linux-kernel,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Liam Girdwood,
	Sangbeom Kim, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 7523 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata':
>> drivers/regulator/s5m8767.c:570:30: error: implicit declaration of function 'devm_fwnode_gpiod_get'; did you mean 'devm_gpiod_get'? [-Werror=implicit-function-declaration]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                                 ^~~~~~~~~~~~~~~~~~~~~
                                 devm_gpiod_get
>> drivers/regulator/s5m8767.c:570:28: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                               ^
   cc1: some warnings being treated as errors

vim +570 drivers/regulator/s5m8767.c

   519	
   520	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   521						struct sec_platform_data *pdata)
   522	{
   523		struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
   524		struct device_node *pmic_np, *regulators_np, *reg_np;
   525		struct sec_regulator_data *rdata;
   526		struct sec_opmode_data *rmode;
   527		unsigned int i, dvs_voltage_nr = 8, ret;
   528	
   529		pmic_np = iodev->dev->of_node;
   530		if (!pmic_np) {
   531			dev_err(iodev->dev, "could not find pmic sub-node\n");
   532			return -ENODEV;
   533		}
   534	
   535		regulators_np = of_get_child_by_name(pmic_np, "regulators");
   536		if (!regulators_np) {
   537			dev_err(iodev->dev, "could not find regulators sub-node\n");
   538			return -EINVAL;
   539		}
   540	
   541		/* count the number of regulators to be supported in pmic */
   542		pdata->num_regulators = of_get_child_count(regulators_np);
   543	
   544		rdata = devm_kcalloc(&pdev->dev,
   545				     pdata->num_regulators, sizeof(*rdata),
   546				     GFP_KERNEL);
   547		if (!rdata)
   548			return -ENOMEM;
   549	
   550		rmode = devm_kcalloc(&pdev->dev,
   551				     pdata->num_regulators, sizeof(*rmode),
   552				     GFP_KERNEL);
   553		if (!rmode)
   554			return -ENOMEM;
   555	
   556		pdata->regulators = rdata;
   557		pdata->opmode = rmode;
   558		for_each_child_of_node(regulators_np, reg_np) {
   559			for (i = 0; i < ARRAY_SIZE(regulators); i++)
   560				if (of_node_name_eq(reg_np, regulators[i].name))
   561					break;
   562	
   563			if (i == ARRAY_SIZE(regulators)) {
   564				dev_warn(iodev->dev,
   565				"don't know how to configure regulator %pOFn\n",
   566				reg_np);
   567				continue;
   568			}
   569	
 > 570			rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
   571				&pdev->dev,
   572				of_fwnode_handle(reg_np),
   573				"s5m8767,pmic-ext-control",
   574				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   575				"s5m8767");
   576			if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
   577				rdata->ext_control_gpiod = NULL;
   578			else if (IS_ERR(rdata->ext_control_gpiod))
   579				return PTR_ERR(rdata->ext_control_gpiod);
   580	
   581			rdata->id = i;
   582			rdata->initdata = of_get_regulator_init_data(
   583							&pdev->dev, reg_np,
   584							&regulators[i]);
   585			rdata->reg_node = reg_np;
   586			rdata++;
   587			rmode->id = i;
   588			if (of_property_read_u32(reg_np, "op_mode",
   589					&rmode->mode)) {
   590				dev_warn(iodev->dev,
   591					"no op_mode property property at %pOF\n",
   592					reg_np);
   593	
   594				rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
   595			}
   596			rmode++;
   597		}
   598	
   599		of_node_put(regulators_np);
   600	
   601		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) {
   602			pdata->buck2_gpiodvs = true;
   603	
   604			if (of_property_read_u32_array(pmic_np,
   605					"s5m8767,pmic-buck2-dvs-voltage",
   606					pdata->buck2_voltage, dvs_voltage_nr)) {
   607				dev_err(iodev->dev, "buck2 voltages not specified\n");
   608				return -EINVAL;
   609			}
   610		}
   611	
   612		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL)) {
   613			pdata->buck3_gpiodvs = true;
   614	
   615			if (of_property_read_u32_array(pmic_np,
   616					"s5m8767,pmic-buck3-dvs-voltage",
   617					pdata->buck3_voltage, dvs_voltage_nr)) {
   618				dev_err(iodev->dev, "buck3 voltages not specified\n");
   619				return -EINVAL;
   620			}
   621		}
   622	
   623		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL)) {
   624			pdata->buck4_gpiodvs = true;
   625	
   626			if (of_property_read_u32_array(pmic_np,
   627					"s5m8767,pmic-buck4-dvs-voltage",
   628					pdata->buck4_voltage, dvs_voltage_nr)) {
   629				dev_err(iodev->dev, "buck4 voltages not specified\n");
   630				return -EINVAL;
   631			}
   632		}
   633	
   634		if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
   635							pdata->buck4_gpiodvs) {
   636			ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
   637			if (ret)
   638				return -EINVAL;
   639	
   640			if (of_property_read_u32(pmic_np,
   641					"s5m8767,pmic-buck-default-dvs-idx",
   642					&pdata->buck_default_idx)) {
   643				pdata->buck_default_idx = 0;
   644			} else {
   645				if (pdata->buck_default_idx >= 8) {
   646					pdata->buck_default_idx = 0;
   647					dev_info(iodev->dev,
   648					"invalid value for default dvs index, use 0\n");
   649				}
   650			}
   651		}
   652	
   653		ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
   654		if (ret)
   655			return -EINVAL;
   656	
   657		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL))
   658			pdata->buck2_ramp_enable = true;
   659	
   660		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL))
   661			pdata->buck3_ramp_enable = true;
   662	
   663		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL))
   664			pdata->buck4_ramp_enable = true;
   665	
   666		if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
   667				|| pdata->buck4_ramp_enable) {
   668			if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
   669					&pdata->buck_ramp_delay))
   670				pdata->buck_ramp_delay = 0;
   671		}
   672	
   673		return 0;
   674	}
   675	#else
   676	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   677						struct sec_platform_data *pdata)
   678	{
   679		return 0;
   680	}
   681	#endif /* CONFIG_OF */
   682	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59595 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
  2019-10-05  6:42   ` kbuild test robot
@ 2019-10-05  6:59   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: s5m8767: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: kbuild test robot @ 2019-10-05  6:59 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Mark Brown, Linus Walleij, linux-kernel,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Liam Girdwood,
	Sangbeom Kim, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 7557 bytes --]

Hi Dmitry,

I love your patch! Perhaps something to improve:

[auto build test WARNING on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata':
   drivers/regulator/s5m8767.c:570:30: error: implicit declaration of function 'devm_fwnode_gpiod_get'; did you mean 'devm_gpiod_get'? [-Werror=implicit-function-declaration]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                                 ^~~~~~~~~~~~~~~~~~~~~
                                 devm_gpiod_get
>> drivers/regulator/s5m8767.c:570:28: warning: assignment to 'struct gpio_desc *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                               ^
   cc1: some warnings being treated as errors

vim +570 drivers/regulator/s5m8767.c

   519	
   520	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   521						struct sec_platform_data *pdata)
   522	{
   523		struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
   524		struct device_node *pmic_np, *regulators_np, *reg_np;
   525		struct sec_regulator_data *rdata;
   526		struct sec_opmode_data *rmode;
   527		unsigned int i, dvs_voltage_nr = 8, ret;
   528	
   529		pmic_np = iodev->dev->of_node;
   530		if (!pmic_np) {
   531			dev_err(iodev->dev, "could not find pmic sub-node\n");
   532			return -ENODEV;
   533		}
   534	
   535		regulators_np = of_get_child_by_name(pmic_np, "regulators");
   536		if (!regulators_np) {
   537			dev_err(iodev->dev, "could not find regulators sub-node\n");
   538			return -EINVAL;
   539		}
   540	
   541		/* count the number of regulators to be supported in pmic */
   542		pdata->num_regulators = of_get_child_count(regulators_np);
   543	
   544		rdata = devm_kcalloc(&pdev->dev,
   545				     pdata->num_regulators, sizeof(*rdata),
   546				     GFP_KERNEL);
   547		if (!rdata)
   548			return -ENOMEM;
   549	
   550		rmode = devm_kcalloc(&pdev->dev,
   551				     pdata->num_regulators, sizeof(*rmode),
   552				     GFP_KERNEL);
   553		if (!rmode)
   554			return -ENOMEM;
   555	
   556		pdata->regulators = rdata;
   557		pdata->opmode = rmode;
   558		for_each_child_of_node(regulators_np, reg_np) {
   559			for (i = 0; i < ARRAY_SIZE(regulators); i++)
   560				if (of_node_name_eq(reg_np, regulators[i].name))
   561					break;
   562	
   563			if (i == ARRAY_SIZE(regulators)) {
   564				dev_warn(iodev->dev,
   565				"don't know how to configure regulator %pOFn\n",
   566				reg_np);
   567				continue;
   568			}
   569	
 > 570			rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
   571				&pdev->dev,
   572				of_fwnode_handle(reg_np),
   573				"s5m8767,pmic-ext-control",
   574				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   575				"s5m8767");
   576			if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
   577				rdata->ext_control_gpiod = NULL;
   578			else if (IS_ERR(rdata->ext_control_gpiod))
   579				return PTR_ERR(rdata->ext_control_gpiod);
   580	
   581			rdata->id = i;
   582			rdata->initdata = of_get_regulator_init_data(
   583							&pdev->dev, reg_np,
   584							&regulators[i]);
   585			rdata->reg_node = reg_np;
   586			rdata++;
   587			rmode->id = i;
   588			if (of_property_read_u32(reg_np, "op_mode",
   589					&rmode->mode)) {
   590				dev_warn(iodev->dev,
   591					"no op_mode property property at %pOF\n",
   592					reg_np);
   593	
   594				rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
   595			}
   596			rmode++;
   597		}
   598	
   599		of_node_put(regulators_np);
   600	
   601		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) {
   602			pdata->buck2_gpiodvs = true;
   603	
   604			if (of_property_read_u32_array(pmic_np,
   605					"s5m8767,pmic-buck2-dvs-voltage",
   606					pdata->buck2_voltage, dvs_voltage_nr)) {
   607				dev_err(iodev->dev, "buck2 voltages not specified\n");
   608				return -EINVAL;
   609			}
   610		}
   611	
   612		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL)) {
   613			pdata->buck3_gpiodvs = true;
   614	
   615			if (of_property_read_u32_array(pmic_np,
   616					"s5m8767,pmic-buck3-dvs-voltage",
   617					pdata->buck3_voltage, dvs_voltage_nr)) {
   618				dev_err(iodev->dev, "buck3 voltages not specified\n");
   619				return -EINVAL;
   620			}
   621		}
   622	
   623		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL)) {
   624			pdata->buck4_gpiodvs = true;
   625	
   626			if (of_property_read_u32_array(pmic_np,
   627					"s5m8767,pmic-buck4-dvs-voltage",
   628					pdata->buck4_voltage, dvs_voltage_nr)) {
   629				dev_err(iodev->dev, "buck4 voltages not specified\n");
   630				return -EINVAL;
   631			}
   632		}
   633	
   634		if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
   635							pdata->buck4_gpiodvs) {
   636			ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
   637			if (ret)
   638				return -EINVAL;
   639	
   640			if (of_property_read_u32(pmic_np,
   641					"s5m8767,pmic-buck-default-dvs-idx",
   642					&pdata->buck_default_idx)) {
   643				pdata->buck_default_idx = 0;
   644			} else {
   645				if (pdata->buck_default_idx >= 8) {
   646					pdata->buck_default_idx = 0;
   647					dev_info(iodev->dev,
   648					"invalid value for default dvs index, use 0\n");
   649				}
   650			}
   651		}
   652	
   653		ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
   654		if (ret)
   655			return -EINVAL;
   656	
   657		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL))
   658			pdata->buck2_ramp_enable = true;
   659	
   660		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL))
   661			pdata->buck3_ramp_enable = true;
   662	
   663		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL))
   664			pdata->buck4_ramp_enable = true;
   665	
   666		if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
   667				|| pdata->buck4_ramp_enable) {
   668			if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
   669					&pdata->buck_ramp_delay))
   670				pdata->buck_ramp_delay = 0;
   671		}
   672	
   673		return 0;
   674	}
   675	#else
   676	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   677						struct sec_platform_data *pdata)
   678	{
   679		return 0;
   680	}
   681	#endif /* CONFIG_OF */
   682	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 53274 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index
  2019-10-04 23:10 ` [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index Dmitry Torokhov
@ 2019-10-05  7:26   ` kbuild test robot
  2019-10-07 13:03   ` Applied "regulator: max77686: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
  1 sibling, 0 replies; 22+ messages in thread
From: kbuild test robot @ 2019-10-05  7:26 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Mark Brown, Linus Walleij, linux-kernel,
	Bartlomiej Zolnierkiewicz, Chanwoo Choi, Krzysztof Kozlowski,
	Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 3110 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers//regulator/max77686-regulator.c: In function 'max77686_of_parse_cb':
>> drivers//regulator/max77686-regulator.c:259:23: error: implicit declaration of function 'fwnode_gpiod_get_index'; did you mean 'devm_gpiod_get_index'? [-Werror=implicit-function-declaration]
      config->ena_gpiod = fwnode_gpiod_get_index(
                          ^~~~~~~~~~~~~~~~~~~~~~
                          devm_gpiod_get_index
>> drivers//regulator/max77686-regulator.c:259:21: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      config->ena_gpiod = fwnode_gpiod_get_index(
                        ^
   cc1: some warnings being treated as errors

vim +259 drivers//regulator/max77686-regulator.c

   247	
   248	static int max77686_of_parse_cb(struct device_node *np,
   249			const struct regulator_desc *desc,
   250			struct regulator_config *config)
   251	{
   252		struct max77686_data *max77686 = config->driver_data;
   253		int ret;
   254	
   255		switch (desc->id) {
   256		case MAX77686_BUCK8:
   257		case MAX77686_BUCK9:
   258		case MAX77686_LDO20 ... MAX77686_LDO22:
 > 259			config->ena_gpiod = fwnode_gpiod_get_index(
   260					of_fwnode_handle(np),
   261					"maxim,ena",
   262					0,
   263					GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   264					"max77686-regulator");
   265			if (IS_ERR(config->ena_gpiod))
   266				config->ena_gpiod = NULL;
   267			break;
   268		default:
   269			return 0;
   270		}
   271	
   272		if (config->ena_gpiod) {
   273			set_bit(desc->id, max77686->gpio_enabled);
   274	
   275			ret = regmap_update_bits(config->regmap, desc->enable_reg,
   276						 desc->enable_mask,
   277						 MAX77686_GPIO_CONTROL);
   278			if (ret) {
   279				gpiod_put(config->ena_gpiod);
   280				config->ena_gpiod = NULL;
   281			}
   282		}
   283	
   284		return 0;
   285	}
   286	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52234 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index
  2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
                   ` (6 preceding siblings ...)
  2019-10-04 23:10 ` [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index Dmitry Torokhov
@ 2019-10-05 19:01 ` Linus Walleij
  7 siblings, 0 replies; 22+ messages in thread
From: Linus Walleij @ 2019-10-05 19:01 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Mark Brown, linux-kernel, Bartlomiej Zolnierkiewicz,
	Chanwoo Choi, Krzysztof Kozlowski, Liam Girdwood, Sangbeom Kim,
	Support Opensource, linux-samsung-soc

On Sat, Oct 5, 2019 at 1:10 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> This series swiches regulator drivers form using
> [devm_]gpiod_get_from_of_node() that is scheduled to be removed in favor
> of [devm_]fwnode_gpiod_get_index() that behaves more like standard
> [devm_]gpiod_get_index() and will potentially handle secondary software
> nodes in cases we need to augment platform firmware.

The series:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Too bad with the build robots being unable to parse the
pull deps. Now they hammer out complaints.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get
  2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
  2019-10-05  6:12   ` kbuild test robot
@ 2019-10-07 10:43   ` Adam Thomson
  2019-10-07 13:03   ` Applied "regulator: da9211: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: Adam Thomson @ 2019-10-07 10:43 UTC (permalink / raw)
  To: Dmitry Torokhov, Mark Brown
  Cc: Linus Walleij, linux-kernel, Liam Girdwood, Support Opensource

On 05 October 2019 00:10, Dmitry Torokhov wrote:

> devm_gpiod_get_from_of_node() is being retired in favor of
> devm_fwnode_gpiod_get_index(), that behaves similar to
> devm_gpiod_get_index(), but can work with arbitrary firmware node. It
> will also be able to support secondary software nodes.
> 
> Let's switch this driver over.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

> ---
> 
>  drivers/regulator/da9211-regulator.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-
> regulator.c
> index bf80748f1ccc..523dc1b95826 100644
> --- a/drivers/regulator/da9211-regulator.c
> +++ b/drivers/regulator/da9211-regulator.c
> @@ -283,12 +283,12 @@ static struct da9211_pdata
> *da9211_parse_regulators_dt(
> 
>  		pdata->init_data[n] = da9211_matches[i].init_data;
>  		pdata->reg_node[n] = da9211_matches[i].of_node;
> -		pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev,
> -				  da9211_matches[i].of_node,
> -				  "enable-gpios",
> -				  0,
> -				  GPIOD_OUT_HIGH |
> GPIOD_FLAGS_BIT_NONEXCLUSIVE,
> -				  "da9211-enable");
> +		pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
> +					of_fwnode_handle(pdata-
> >reg_node[n]),
> +					"enable",
> +					GPIOD_OUT_HIGH |
> +
> 	GPIOD_FLAGS_BIT_NONEXCLUSIVE,
> +					"da9211-enable");
>  		if (IS_ERR(pdata->gpiod_ren[n]))
>  			pdata->gpiod_ren[n] = NULL;
>  		n++;
> --
> 2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Applied "regulator: tps65132: switch to using devm_fwnode_gpiod_get()" to the regulator tree
  2019-10-04 23:10 ` [PATCH 6/7] regulator: tps65132: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
@ 2019-10-07 13:03   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Liam Girdwood, Linus Walleij, linux-kernel, Mark Brown

The patch

   regulator: tps65132: switch to using devm_fwnode_gpiod_get()

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 22803ca3c56b02e5bb8a4eb14104114009fd1c65 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:16 -0700
Subject: [PATCH] regulator: tps65132: switch to using devm_fwnode_gpiod_get()

devm_fwnode_get_index_gpiod_from_child() is going away as the name is
too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Note that we no longer need to check for NULL as devm_fwnode_gpiod_get()
will return -ENOENT if GPIO is missing.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-7-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/tps65132-regulator.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/tps65132-regulator.c b/drivers/regulator/tps65132-regulator.c
index e302bd01a084..7b0e38f8d627 100644
--- a/drivers/regulator/tps65132-regulator.c
+++ b/drivers/regulator/tps65132-regulator.c
@@ -136,9 +136,10 @@ static int tps65132_of_parse_cb(struct device_node *np,
 	struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[desc->id];
 	int ret;
 
-	rpdata->en_gpiod = devm_fwnode_get_index_gpiod_from_child(tps->dev,
-					"enable", 0, &np->fwnode, 0, "enable");
-	if (IS_ERR_OR_NULL(rpdata->en_gpiod)) {
+	rpdata->en_gpiod = devm_fwnode_gpiod_get(tps->dev, of_fwnode_handle(np),
+						 "enable", GPIOD_ASIS,
+						 "enable");
+	if (IS_ERR(rpdata->en_gpiod)) {
 		ret = PTR_ERR(rpdata->en_gpiod);
 
 		/* Ignore the error other than probe defer */
@@ -147,10 +148,12 @@ static int tps65132_of_parse_cb(struct device_node *np,
 		return 0;
 	}
 
-	rpdata->act_dis_gpiod = devm_fwnode_get_index_gpiod_from_child(
-					tps->dev, "active-discharge", 0,
-					&np->fwnode, 0, "active-discharge");
-	if (IS_ERR_OR_NULL(rpdata->act_dis_gpiod)) {
+	rpdata->act_dis_gpiod = devm_fwnode_gpiod_get(tps->dev,
+						      of_fwnode_handle(np),
+						      "active-discharge",
+						      GPIOD_ASIS,
+						      "active-discharge");
+	if (IS_ERR(rpdata->act_dis_gpiod)) {
 		ret = PTR_ERR(rpdata->act_dis_gpiod);
 
 		/* Ignore the error other than probe defer */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: max77686: switch to using fwnode_gpiod_get_index" to the regulator tree
  2019-10-04 23:10 ` [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index Dmitry Torokhov
  2019-10-05  7:26   ` kbuild test robot
@ 2019-10-07 13:03   ` Mark Brown
  1 sibling, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Bartlomiej Zolnierkiewicz, Chanwoo Choi, Krzysztof Kozlowski,
	Liam Girdwood, Linus Walleij, linux-kernel, Mark Brown

The patch

   regulator: max77686: switch to using fwnode_gpiod_get_index

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 0b2ba815fb5cbfab253f175d0b0d0d93d7ab9b5d Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:17 -0700
Subject: [PATCH] regulator: max77686: switch to using fwnode_gpiod_get_index

gpiod_get_from_of_node() is being retired in favor of
fwnode_gpiod_get_index(), that behaves similar to gpiod_get_index(),
but can work with arbitrary firmware node. It will also be able to
support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-8-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/max77686-regulator.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/max77686-regulator.c b/drivers/regulator/max77686-regulator.c
index c8e579e99316..9089ec608fcc 100644
--- a/drivers/regulator/max77686-regulator.c
+++ b/drivers/regulator/max77686-regulator.c
@@ -256,8 +256,9 @@ static int max77686_of_parse_cb(struct device_node *np,
 	case MAX77686_BUCK8:
 	case MAX77686_BUCK9:
 	case MAX77686_LDO20 ... MAX77686_LDO22:
-		config->ena_gpiod = gpiod_get_from_of_node(np,
-				"maxim,ena-gpios",
+		config->ena_gpiod = fwnode_gpiod_get_index(
+				of_fwnode_handle(np),
+				"maxim,ena",
 				0,
 				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 				"max77686-regulator");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: da9211: switch to using devm_fwnode_gpiod_get" to the regulator tree
  2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
  2019-10-05  6:12   ` kbuild test robot
  2019-10-07 10:43   ` Adam Thomson
@ 2019-10-07 13:03   ` Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Adam Thomson, Liam Girdwood, Linus Walleij, linux-kernel,
	Mark Brown, Support Opensource

The patch

   regulator: da9211: switch to using devm_fwnode_gpiod_get

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 61d2fc3cf8f557193c8c362ea75f06fa5a0abcfe Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:15 -0700
Subject: [PATCH] regulator: da9211: switch to using devm_fwnode_gpiod_get

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20191004231017.130290-6-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/da9211-regulator.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c
index bf80748f1ccc..523dc1b95826 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -283,12 +283,12 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
 
 		pdata->init_data[n] = da9211_matches[i].init_data;
 		pdata->reg_node[n] = da9211_matches[i].of_node;
-		pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev,
-				  da9211_matches[i].of_node,
-				  "enable-gpios",
-				  0,
-				  GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
-				  "da9211-enable");
+		pdata->gpiod_ren[n] = devm_fwnode_gpiod_get(dev,
+					of_fwnode_handle(pdata->reg_node[n]),
+					"enable",
+					GPIOD_OUT_HIGH |
+						GPIOD_FLAGS_BIT_NONEXCLUSIVE,
+					"da9211-enable");
 		if (IS_ERR(pdata->gpiod_ren[n]))
 			pdata->gpiod_ren[n] = NULL;
 		n++;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: slg51000: switch to using fwnode_gpiod_get_index" to the regulator tree
  2019-10-04 23:10 ` [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index Dmitry Torokhov
  2019-10-05  5:36   ` kbuild test robot
@ 2019-10-07 13:03   ` Mark Brown
  1 sibling, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Liam Girdwood, Linus Walleij, linux-kernel, Mark Brown,
	Support Opensource

The patch

   regulator: slg51000: switch to using fwnode_gpiod_get_index

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From de2cd1a552673f370f8ea39a0241f764fbcf39e5 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:12 -0700
Subject: [PATCH] regulator: slg51000: switch to using fwnode_gpiod_get_index

devm_gpiod_get_from_of_node() is being retired in favor of
[devm_]fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Note that now that we have a good non-devm API for getting GPIO from
arbitrary firmware node, there is no reason to use devm API here as
regulator core takes care of managing lifetime of "enable" GPIO and we
were immediately detaching requested GPIO from devm anyway.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-3-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/slg51000-regulator.c | 13 +++++--------
 1 file 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;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: s2mps11: switch to using devm_fwnode_gpiod_get" to the regulator tree
  2019-10-04 23:10 ` [PATCH 4/7] regulator: s2mps11: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-07 13:03   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Liam Girdwood,
	Linus Walleij, linux-kernel, linux-samsung-soc, Mark Brown,
	Sangbeom Kim

The patch

   regulator: s2mps11: switch to using devm_fwnode_gpiod_get

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From de2792b507675641885075bc99e283de861b1ce6 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:14 -0700
Subject: [PATCH] regulator: s2mps11: switch to using devm_fwnode_gpiod_get

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-5-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/s2mps11.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 5bc00884cf51..4f2dc5ebffdc 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -844,10 +844,9 @@ static void s2mps14_pmic_dt_parse_ext_control_gpio(struct platform_device *pdev,
 		if (!rdata[reg].init_data || !rdata[reg].of_node)
 			continue;
 
-		gpio[reg] = devm_gpiod_get_from_of_node(&pdev->dev,
-				rdata[reg].of_node,
-				"samsung,ext-control-gpios",
-				0,
+		gpio[reg] = devm_fwnode_gpiod_get(&pdev->dev,
+				of_fwnode_handle(rdata[reg].of_node),
+				"samsung,ext-control",
 				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 				"s2mps11-regulator");
 		if (PTR_ERR(gpio[reg]) == -ENOENT)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: tps65090: switch to using devm_fwnode_gpiod_get" to the regulator tree
  2019-10-04 23:10 ` [PATCH 3/7] regulator: tps65090: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
@ 2019-10-07 13:03   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Liam Girdwood, Linus Walleij, linux-kernel, Mark Brown

The patch

   regulator: tps65090: switch to using devm_fwnode_gpiod_get

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 51d98ff8616a3c46233bdd1b714b8f19537bc9a8 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:13 -0700
Subject: [PATCH] regulator: tps65090: switch to using devm_fwnode_gpiod_get

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-4-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/tps65090-regulator.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 10ea4b5a0f55..f0b660e9f15f 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -346,16 +346,20 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 	for (idx = 0; idx < ARRAY_SIZE(tps65090_matches); idx++) {
 		struct regulator_init_data *ri_data;
 		struct tps65090_regulator_plat_data *rpdata;
+		struct device_node *np;
 
 		rpdata = &reg_pdata[idx];
 		ri_data = tps65090_matches[idx].init_data;
-		if (!ri_data || !tps65090_matches[idx].of_node)
+		if (!ri_data)
+			continue;
+
+		np = tps65090_matches[idx].of_node;
+		if (!np)
 			continue;
 
 		rpdata->reg_init_data = ri_data;
-		rpdata->enable_ext_control = of_property_read_bool(
-					tps65090_matches[idx].of_node,
-					"ti,enable-ext-control");
+		rpdata->enable_ext_control = of_property_read_bool(np,
+						"ti,enable-ext-control");
 		if (rpdata->enable_ext_control) {
 			enum gpiod_flags gflags;
 
@@ -366,11 +370,12 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 				gflags = GPIOD_OUT_LOW;
 			gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-			rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev,
-								    tps65090_matches[idx].of_node,
-								    "dcdc-ext-control-gpios", 0,
-								    gflags,
-								    "tps65090");
+			rpdata->gpiod = devm_fwnode_gpiod_get(
+							&pdev->dev,
+							of_fwnode_handle(np),
+							"dcdc-ext-control",
+							gflags,
+							"tps65090");
 			if (PTR_ERR(rpdata->gpiod) == -ENOENT) {
 				dev_err(&pdev->dev,
 					"could not find DCDC external control GPIO\n");
@@ -379,8 +384,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
 				return ERR_CAST(rpdata->gpiod);
 		}
 
-		if (of_property_read_u32(tps65090_matches[idx].of_node,
-					 "ti,overcurrent-wait",
+		if (of_property_read_u32(np, "ti,overcurrent-wait",
 					 &rpdata->overcurrent_wait) == 0)
 			rpdata->overcurrent_wait_valid = true;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "regulator: s5m8767: switch to using devm_fwnode_gpiod_get" to the regulator tree
  2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
  2019-10-05  6:42   ` kbuild test robot
  2019-10-05  6:59   ` kbuild test robot
@ 2019-10-07 13:03   ` Mark Brown
  2 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2019-10-07 13:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Liam Girdwood,
	Linus Walleij, linux-kernel, linux-samsung-soc, Mark Brown,
	Sangbeom Kim

The patch

   regulator: s5m8767: switch to using devm_fwnode_gpiod_get

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 5be0e549e18f8ad7efa81b3e054ca094b7782f55 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Fri, 4 Oct 2019 16:10:11 -0700
Subject: [PATCH] regulator: s5m8767: switch to using devm_fwnode_gpiod_get

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-2-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/s5m8767.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 6ca27e9d5ef7..bdc07739e9a2 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -567,11 +567,10 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 			continue;
 		}
 
-		rdata->ext_control_gpiod = devm_gpiod_get_from_of_node(
+		rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
 			&pdev->dev,
-			reg_np,
-			"s5m8767,pmic-ext-control-gpios",
-			0,
+			of_fwnode_handle(reg_np),
+			"s5m8767,pmic-ext-control",
 			GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
 			"s5m8767");
 		if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-10-07 13:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 23:10 [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Dmitry Torokhov
2019-10-04 23:10 ` [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
2019-10-05  6:42   ` kbuild test robot
2019-10-05  6:59   ` kbuild test robot
2019-10-07 13:03   ` Applied "regulator: s5m8767: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 2/7] regulator: slg51000: switch to using fwnode_gpiod_get_index Dmitry Torokhov
2019-10-05  5:36   ` kbuild test robot
2019-10-07 13:03   ` Applied "regulator: slg51000: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 3/7] regulator: tps65090: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
2019-10-07 13:03   ` Applied "regulator: tps65090: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 4/7] regulator: s2mps11: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
2019-10-07 13:03   ` Applied "regulator: s2mps11: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 5/7] regulator: da9211: switch to using devm_fwnode_gpiod_get Dmitry Torokhov
2019-10-05  6:12   ` kbuild test robot
2019-10-07 10:43   ` Adam Thomson
2019-10-07 13:03   ` Applied "regulator: da9211: switch to using devm_fwnode_gpiod_get" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 6/7] regulator: tps65132: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
2019-10-07 13:03   ` Applied "regulator: tps65132: switch to using devm_fwnode_gpiod_get()" to the regulator tree Mark Brown
2019-10-04 23:10 ` [PATCH 7/7] regulator: max77686: switch to using fwnode_gpiod_get_index Dmitry Torokhov
2019-10-05  7:26   ` kbuild test robot
2019-10-07 13:03   ` Applied "regulator: max77686: switch to using fwnode_gpiod_get_index" to the regulator tree Mark Brown
2019-10-05 19:01 ` [PATCH 0/7] regulator: switch to using [devm_]fwnode_gpiod_get_index Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).