[PATCH 20/26] dm: core: Rename dev_has_of_node() to dev_has_ofnode()

Simon Glass sjg at chromium.org
Sat Dec 19 18:40:12 CET 2020


We use 'ofnode' rather than 'of_node' in U-Boot. Rename this function to
fit.

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

 drivers/core/device.c            | 2 +-
 drivers/mmc/octeontx_hsmmc.c     | 2 +-
 drivers/pinctrl/pinctrl-uclass.c | 2 +-
 drivers/usb/host/usb-uclass.c    | 2 +-
 include/dm/device.h              | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index ba50d46effe..8c7ce220f84 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -406,7 +406,7 @@ int device_of_to_plat(struct udevice *dev)
 	assert(drv);
 
 	if (drv->of_to_plat &&
-	    (CONFIG_IS_ENABLED(OF_PLATDATA) || dev_has_of_node(dev))) {
+	    (CONFIG_IS_ENABLED(OF_PLATDATA) || dev_has_ofnode(dev))) {
 		ret = drv->of_to_plat(dev);
 		if (ret)
 			goto fail;
diff --git a/drivers/mmc/octeontx_hsmmc.c b/drivers/mmc/octeontx_hsmmc.c
index 57d107aac32..f3da6af9090 100644
--- a/drivers/mmc/octeontx_hsmmc.c
+++ b/drivers/mmc/octeontx_hsmmc.c
@@ -3752,7 +3752,7 @@ static int octeontx_mmc_host_probe(struct udevice *dev)
 	host->dev = dev;
 	debug("%s(%s): Base address: %p\n", __func__, dev->name,
 	      host->base_addr);
-	if (!dev_has_of_node(dev)) {
+	if (!dev_has_ofnode(dev)) {
 		pr_err("%s: No device tree information found\n", __func__);
 		return -1;
 	}
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 4e474cbff73..4653e86ba46 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -305,7 +305,7 @@ int pinctrl_select_state(struct udevice *dev, const char *statename)
 	 * Some device which is logical like mmc.blk, do not have
 	 * a valid ofnode.
 	 */
-	if (!dev_has_of_node(dev))
+	if (!dev_has_ofnode(dev))
 		return 0;
 	/*
 	 * Try full-implemented pinctrl first.
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 17db5eb0609..ae6b1450d3a 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -517,7 +517,7 @@ static ofnode usb_get_ofnode(struct udevice *hub, int port)
 	ofnode node;
 	u32 reg;
 
-	if (!dev_has_of_node(hub))
+	if (!dev_has_ofnode(hub))
 		return ofnode_null();
 
 	/*
diff --git a/include/dm/device.h b/include/dm/device.h
index a0c1752cddc..b15a14ec330 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -200,7 +200,7 @@ static inline int dev_of_offset(const struct udevice *dev)
 	return ofnode_to_offset(dev->node);
 }
 
-static inline bool dev_has_of_node(struct udevice *dev)
+static inline bool dev_has_ofnode(struct udevice *dev)
 {
 	return ofnode_valid(dev->node);
 }
-- 
2.29.2.684.gfbc64c5ab5-goog



More information about the U-Boot mailing list