summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@fitzsim.org>2019-09-06 07:51:18 -0400
committerSimon Glass <sjg@chromium.org>2019-10-15 08:40:02 -0600
commit7f3289bf6dee6e4e6c7d95d3ee16d3ab3d55de55 (patch)
tree2e1ba8a5e3f2790fd11de9ce22d707777627c6a2 /drivers/core/device.c
parentd8206ff198afaf36061efb14ff6af5e6119b30e7 (diff)
dm: device: Request next sequence number
For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a given device, use the next request number for that type of device. This allows aliases to be used when they're available, while still allowing unaliased devices to be probed. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index ce66c72e5e..24b940eac2 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -82,6 +82,11 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
if (uc->uc_drv->name && ofnode_valid(node))
dev_read_alias_seq(dev, &dev->req_seq);
+#if CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
+ if (dev->req_seq == -1)
+ dev->req_seq =
+ uclass_find_next_free_req_seq(drv->id);
+#endif
} else {
dev->req_seq = uclass_find_next_free_req_seq(drv->id);
}