[U-Boot] [PATCH 19/22] dm: gpio: sandbox: Use dm_read...() functions to access DT

Simon Glass sjg at chromium.org
Wed Jan 18 06:51:55 CET 2017


Use the new dm_read...() functions to access the device tree, so that a
live tree can be used.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/gpio/sandbox.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 5bf6bb127d1..ef9a05bf880 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -199,10 +199,8 @@ static int sandbox_gpio_ofdata_to_platdata(struct udevice *dev)
 {
 	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
 
-	uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					     "num-gpios", 0);
-	uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
-					 "gpio-bank-name", NULL);
+	uc_priv->gpio_count = dev_read_u32_defaut(dev, "num-gpios", 0);
+	uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
 
 	return 0;
 }
-- 
2.11.0.483.g087da7b7c-goog



More information about the U-Boot mailing list