Skip to contentSkip to conversation

gpio: Convert to use APIs which support live DT

PATCH New Patrick Delaunay 4 participants 4 messages Sep 9, 2020 – Dec 2, 2020 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: Convert to use APIs which support live DT

Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT.

---

 drivers/gpio/gpio-uclass.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpio/gpio-uclass.c +2 -3
index 9c53299b6a..1d3255ca60 100644
@@ -1098,9 +1098,8 @@ int gpio_get_list_count(struct udevice *dev, const char *list_name)
 {
 	int ret;
 
-	ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev),
-					     list_name, "#gpio-cells", 0, -1,
-					     NULL);
+	ret = dev_read_phandle_with_args(dev, list_name, "#gpio-cells", 0, -1,
+					 NULL);
 	if (ret) {
 		debug("%s: Node '%s', property '%s', GPIO count failed: %d\n",
 		      __func__, dev->name, list_name, ret);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 gpio: Convert to use APIs which support live DT

In reply to Patrick Delaunay

Hello Patrick,

Am 09.09.2020 um 18:26 schrieb Patrick Delaunay:

Quoted 8 lines

Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT.

---

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

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#3 lore raw

PATCH 1/1 gpio: Convert to use APIs which support live DT

In reply to Patrick Delaunay
Quoted 6 lines · Patrick Delaunay

Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201202/dc08f6f6/attachment.sig>