diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-17 07:20:29 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-12-19 06:32:21 +0300 |
commit | 991759196faa74b2e7df1cb8e87820f4ec7285f8 (patch) | |
tree | c006a0c22ee148df5c777c865751bdd3e4a72199 /drivers/core/uclass.c | |
parent | b5b11558bc2d7088dfbb67253d8b094782334dea (diff) | |
download | u-boot-991759196faa74b2e7df1cb8e87820f4ec7285f8.tar.xz |
dm: Drop the unused arg in uclass_find_device_by_seq()
Now that there is only one sequence number (rather than both requested and
assigned ones) we can simplify this function. Also update its caller to
simplify the logic.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r-- | drivers/core/uclass.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 78765e548e..42c9ba5828 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -288,25 +288,23 @@ int uclass_find_next_free_req_seq(struct uclass *uc) return max + 1; } -int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq, - bool find_req_seq, struct udevice **devp) +int uclass_find_device_by_seq(enum uclass_id id, int seq, struct udevice **devp) { struct uclass *uc; struct udevice *dev; int ret; *devp = NULL; - log_debug("%d %d\n", find_req_seq, seq_or_req_seq); - if (seq_or_req_seq == -1) + log_debug("%d\n", seq); + if (seq == -1) return -ENODEV; ret = uclass_get(id, &uc); if (ret) return ret; uclass_foreach_dev(dev, uc) { - log_debug(" - %d %d '%s'\n", - dev->req_seq, dev_seq(dev), dev->name); - if (dev_seq(dev) == seq_or_req_seq) { + log_debug(" - %d '%s'\n", dev->sqq, dev->name); + if (dev->sqq == seq) { *devp = dev; log_debug(" - found\n"); return 0; @@ -466,14 +464,8 @@ int uclass_get_device_by_seq(enum uclass_id id, int seq, struct udevice **devp) int ret; *devp = NULL; - ret = uclass_find_device_by_seq(id, seq, false, &dev); - if (ret == -ENODEV) { - /* - * We didn't find it in probed devices. See if there is one - * that will request this seq if probed. - */ - ret = uclass_find_device_by_seq(id, seq, true, &dev); - } + ret = uclass_find_device_by_seq(id, seq, &dev); + return uclass_get_device_tail(dev, ret, devp); } |