[PATCH v2 21/26] dm: Drop uclass_resolve_seq()

Simon Glass sjg at chromium.org
Fri Dec 11 02:31:46 CET 2020


This function is not needed anymore. Drop it.

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

(no changes since v1)

 drivers/core/device.c |  8 --------
 drivers/core/uclass.c | 39 ---------------------------------------
 include/dm/uclass.h   | 15 ---------------
 3 files changed, 62 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 89abc0021c8..37b181cf332 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -427,7 +427,6 @@ int device_probe(struct udevice *dev)
 {
 	const struct driver *drv;
 	int ret;
-	int seq;
 
 	if (!dev)
 		return -EINVAL;
@@ -458,13 +457,6 @@ int device_probe(struct udevice *dev)
 			return 0;
 	}
 
-	seq = uclass_resolve_seq(dev);
-	if (seq < 0) {
-		ret = seq;
-		goto fail;
-	}
-	dev->seq = seq;
-
 	dev->flags |= DM_FLAG_ACTIVATED;
 
 	/*
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 452599b87e8..7993ea807d4 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -680,45 +680,6 @@ int uclass_unbind_device(struct udevice *dev)
 }
 #endif
 
-int uclass_resolve_seq(struct udevice *dev)
-{
-	struct uclass *uc = dev->uclass;
-	struct uclass_driver *uc_drv = uc->uc_drv;
-	struct udevice *dup;
-	int seq = 0;
-	int ret;
-
-	assert(dev_seq(dev) == -1);
-	ret = uclass_find_device_by_seq(uc_drv->id, dev->req_seq, false, &dup);
-	if (!ret) {
-		/* Do nothing here for now */
-	} else if (ret == -ENODEV) {
-		/* Our requested sequence number is available */
-		if (dev->req_seq != -1)
-			return dev->req_seq;
-	} else {
-		return ret;
-	}
-
-	if (CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_SEQ_ALIAS) &&
-	    (uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS)) {
-		/*
-		 * dev_read_alias_highest_id() will return -1 if there no
-		 * alias. Thus we can always add one.
-		 */
-		seq = dev_read_alias_highest_id(uc_drv->name) + 1;
-	}
-
-	for (; seq < DM_MAX_SEQ; seq++) {
-		ret = uclass_find_device_by_seq(uc_drv->id, seq, false, &dup);
-		if (ret == -ENODEV)
-			break;
-		if (ret)
-			return ret;
-	}
-	return seq;
-}
-
 int uclass_pre_probe_device(struct udevice *dev)
 {
 	struct uclass_driver *uc_drv;
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 71883043046..dab5b5b03a9 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -365,21 +365,6 @@ int uclass_next_device_check(struct udevice **devp);
 int uclass_first_device_drvdata(enum uclass_id id, ulong driver_data,
 				struct udevice **devp);
 
-/**
- * uclass_resolve_seq() - Resolve a device's sequence number
- *
- * On entry dev->seq is -1, and dev->req_seq may be -1 (to allocate a
- * sequence number automatically, or >= 0 to select a particular number.
- * If the requested sequence number is in use, then this device will
- * be allocated another one.
- *
- * Note that the device's seq value is not changed by this function.
- *
- * @dev: Device for which to allocate sequence number
- * @return sequence number allocated, or -ve on error
- */
-int uclass_resolve_seq(struct udevice *dev);
-
 /**
  * uclass_id_foreach_dev() - Helper function to iteration through devices
  *
-- 
2.29.2.576.ga3fc446d84-goog



More information about the U-Boot mailing list