[U-Boot] [PATCH v3 59/72] dm: power-domain: Update uclass to support livetree

Simon Glass sjg at chromium.org
Fri May 19 02:09:49 UTC 2017


Update the power domain uclass to support livetree. Fix the xlate() method
which has no callers.

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

Changes in v3: None
Changes in v2: None

 drivers/power/domain/power-domain-uclass.c | 19 ++++++++-----------
 include/power-domain-uclass.h              |  2 +-
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c
index 3dabbe4ac0..1847a492a3 100644
--- a/drivers/power/domain/power-domain-uclass.c
+++ b/drivers/power/domain/power-domain-uclass.c
@@ -6,7 +6,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <power-domain.h>
 #include <power-domain-uclass.h>
 
@@ -18,7 +17,7 @@ static inline struct power_domain_ops *power_domain_dev_ops(struct udevice *dev)
 }
 
 static int power_domain_of_xlate_default(struct power_domain *power_domain,
-				       struct fdtdec_phandle_args *args)
+					 struct ofnode_phandle_args *args)
 {
 	debug("%s(power_domain=%p)\n", __func__, power_domain);
 
@@ -34,27 +33,25 @@ static int power_domain_of_xlate_default(struct power_domain *power_domain,
 
 int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
 {
-	struct fdtdec_phandle_args args;
+	struct ofnode_phandle_args args;
 	int ret;
 	struct udevice *dev_power_domain;
 	struct power_domain_ops *ops;
 
 	debug("%s(dev=%p, power_domain=%p)\n", __func__, dev, power_domain);
 
-	ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev),
-					     "power-domains",
-					     "#power-domain-cells", 0, 0,
-					     &args);
+	ret = dev_read_phandle_with_args(dev, "power-domains",
+					 "#power-domain-cells", 0, 0, &args);
 	if (ret) {
-		debug("%s: fdtdec_parse_phandle_with_args failed: %d\n",
+		debug("%s: dev_read_phandle_with_args failed: %d\n",
 		      __func__, ret);
 		return ret;
 	}
 
-	ret = uclass_get_device_by_of_offset(UCLASS_POWER_DOMAIN, args.node,
-					     &dev_power_domain);
+	ret = uclass_get_device_by_ofnode(UCLASS_POWER_DOMAIN, args.node,
+					  &dev_power_domain);
 	if (ret) {
-		debug("%s: uclass_get_device_by_of_offset failed: %d\n",
+		debug("%s: uclass_get_device_by_ofnode failed: %d\n",
 		      __func__, ret);
 		return ret;
 	}
diff --git a/include/power-domain-uclass.h b/include/power-domain-uclass.h
index 5878021e32..802233d17f 100644
--- a/include/power-domain-uclass.h
+++ b/include/power-domain-uclass.h
@@ -40,7 +40,7 @@ struct power_domain_ops {
 	 * @return 0 if OK, or a negative error code.
 	 */
 	int (*of_xlate)(struct power_domain *power_domain,
-			struct fdtdec_phandle_args *args);
+			struct ofnode_phandle_args *args);
 	/**
 	 * request - Request a translated power domain.
 	 *
-- 
2.13.0.303.g4ebf302169-goog



More information about the U-Boot mailing list