All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind()
Date: Sat, 28 Nov 2020 17:50:01 -0700	[thread overview]
Message-ID: <20201128174958.2.Ib100c98f398ec68c4b7e04ade5493c5819c7dbce@changeid> (raw)
In-Reply-To: <20201129005011.2104545-1-sjg@chromium.org>

This is the standard function to use when binding devices. Drop the
'_ofnode' suffix to make this clear.

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

 drivers/core/device.c                     | 6 +++---
 drivers/firmware/scmi/scmi_agent-uclass.c | 4 ++--
 drivers/gpio/dwapb_gpio.c                 | 4 ++--
 drivers/misc/i2c_eeprom.c                 | 4 ++--
 drivers/mtd/spi/sandbox.c                 | 2 +-
 drivers/pci/pci-uclass.c                  | 4 ++--
 drivers/pci/pci_mvebu.c                   | 4 ++--
 drivers/usb/host/usb-uclass.c             | 4 ++--
 include/dm/device-internal.h              | 6 +++---
 test/dm/core.c                            | 4 ++--
 10 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 081dd1f7780..c8a219d77b3 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -240,9 +240,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv,
 				  offset_to_ofnode(of_offset), 0, devp);
 }
 
-int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, ofnode node,
-		       struct udevice **devp)
+int device_bind(struct udevice *parent, const struct driver *drv,
+		const char *name, void *platdata, ofnode node,
+		struct udevice **devp)
 {
 	return device_bind_common(parent, drv, name, platdata, 0, node, 0,
 				  devp);
diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
index 7dc533149b6..b3d3f0a51b0 100644
--- a/drivers/firmware/scmi/scmi_agent-uclass.c
+++ b/drivers/firmware/scmi/scmi_agent-uclass.c
@@ -89,8 +89,8 @@ static int scmi_bind_protocols(struct udevice *dev)
 			continue;
 		}
 
-		ret = device_bind_ofnode(dev, drv, ofnode_get_name(node),
-					 NULL, node, NULL);
+		ret = device_bind(dev, drv, ofnode_get_name(node), NULL, node,
+				  NULL);
 		if (ret)
 			break;
 	}
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
index 37916e77716..cf20a5024e0 100644
--- a/drivers/gpio/dwapb_gpio.c
+++ b/drivers/gpio/dwapb_gpio.c
@@ -202,8 +202,8 @@ static int gpio_dwapb_bind(struct udevice *dev)
 			}
 		}
 
-		ret = device_bind_ofnode(dev, dev->driver, plat->name,
-					 plat, node, &subdev);
+		ret = device_bind(dev, dev->driver, plat->name, plat, node,
+				  &subdev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index 3651ba4871e..92e18356254 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -131,8 +131,8 @@ static int i2c_eeprom_std_bind(struct udevice *dev)
 		if (!name)
 			continue;
 
-		device_bind_ofnode(dev, DM_GET_DRIVER(i2c_eeprom_partition),
-				   name, NULL, partition, NULL);
+		device_bind(dev, DM_GET_DRIVER(i2c_eeprom_partition), name,
+			    NULL, partition, NULL);
 	}
 
 	return 0;
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 0b602dc9140..1d0c1cb3fa2 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -538,7 +538,7 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
 	str = strdup(name);
 	if (!str)
 		return -ENOMEM;
-	ret = device_bind_ofnode(bus, drv, str, NULL, node, &emul);
+	ret = device_bind(bus, drv, str, NULL, node, &emul);
 	if (ret) {
 		free(str);
 		printf("Cannot create emul device for spec '%s' (err=%d)\n",
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index eb07d253011..9230cfe88b5 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -750,8 +750,8 @@ static int pci_find_and_bind_driver(struct udevice *parent,
 			 * find another driver. For now this doesn't seem
 			 * necesssary, so just bind the first match.
 			 */
-			ret = device_bind_ofnode(parent, drv, drv->name, NULL,
-						 node, &dev);
+			ret = device_bind(parent, drv, drv->name, NULL, node,
+					  &dev);
 			if (ret)
 				goto error;
 			debug("%s: Match found: %s\n", __func__, drv->name);
diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
index c9afe751501..ba1c139dbc5 100644
--- a/drivers/pci/pci_mvebu.c
+++ b/drivers/pci/pci_mvebu.c
@@ -501,8 +501,8 @@ static int mvebu_pcie_bind(struct udevice *parent)
 			return -ENOMEM;
 
 		/* Create child device UCLASS_PCI and bind it */
-		device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie,
-				   subnode, &dev);
+		device_bind(parent, &pcie_mvebu_drv, pcie->name, pcie, subnode,
+			    &dev);
 	}
 
 	return 0;
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 8773824e057..2f8c9037c12 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -581,8 +581,8 @@ static int usb_find_and_bind_driver(struct udevice *parent,
 			 * find another driver. For now this doesn't seem
 			 * necesssary, so just bind the first match.
 			 */
-			ret = device_bind_ofnode(parent, drv, drv->name, NULL,
-						 node, &dev);
+			ret = device_bind(parent, drv, drv->name, NULL, node,
+					  &dev);
 			if (ret)
 				goto error;
 			debug("%s: Match found: %s\n", __func__, drv->name);
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 59d3be09a1e..636210f73ed 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -40,9 +40,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv,
 		       const char *name, void *platdata, int of_offset,
 		       struct udevice **devp);
 
-int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, ofnode node,
-		       struct udevice **devp);
+int device_bind(struct udevice *parent, const struct driver *drv,
+		const char *name, void *platdata, ofnode node,
+		struct udevice **devp);
 
 /**
  * device_bind_with_driver_data() - Create a device and bind it to a driver
diff --git a/test/dm/core.c b/test/dm/core.c
index 6f380a574cf..ba9e60d09cb 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -1052,8 +1052,8 @@ static int dm_test_inactive_child(struct unit_test_state *uts)
 	 */
 	ut_asserteq(-ENODEV, device_find_first_inactive_child(parent,
 							UCLASS_TEST, &dev1));
-	ut_assertok(device_bind_ofnode(parent, DM_GET_DRIVER(test_drv),
-				       "test_child", 0, ofnode_null(), &dev1));
+	ut_assertok(device_bind(parent, DM_GET_DRIVER(test_drv),
+				"test_child", 0, ofnode_null(), &dev1));
 
 	ut_assertok(device_find_first_inactive_child(parent, UCLASS_TEST,
 						     &dev2));
-- 
2.29.2.454.gaff20da3a2-goog

  parent reply	other threads:[~2020-11-29  0:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
2020-11-29  0:50 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
2020-11-29  0:50 ` Simon Glass [this message]
2020-11-29  0:50 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
2020-11-29  0:50 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
2020-11-29  0:50 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
2020-11-29  0:50 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
2020-11-29  0:50 ` [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt() Simon Glass
2020-12-10  0:26 ` Simon Glass
2020-12-10  0:26 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
2020-12-10  0:26 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
2020-12-10  0:26 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
2020-12-10  0:26 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
2020-12-10  0:26 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
2020-12-10  0:26 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
2020-12-10  0:26   ` Simon Glass
2020-12-10  0:26 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
2020-12-10  0:26   ` Simon Glass
2021-01-31  9:18   ` Eugen.Hristev at microchip.com
2021-01-31  9:18     ` Eugen.Hristev
2021-01-31 15:37     ` Simon Glass
2021-01-31 15:37       ` Simon Glass
2021-02-01  8:13       ` Eugen.Hristev at microchip.com
2021-02-01  8:13         ` Eugen.Hristev
2021-02-01 12:02         ` Simon Glass
2021-02-01 12:02           ` Simon Glass
2021-02-01 12:14           ` Eugen.Hristev at microchip.com
2020-12-10  0:26 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
2020-12-10  0:26 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
2020-12-10  0:26 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
2020-12-10  0:26   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201128174958.2.Ib100c98f398ec68c4b7e04ade5493c5819c7dbce@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.