dm: core: Add a new sequence number for devices
authorSimon Glass <sjg@chromium.org>
Thu, 17 Dec 2020 04:20:09 +0000 (21:20 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 19 Dec 2020 03:32:21 +0000 (20:32 -0700)
commitcd53e5bf4bba421d98eb42ec71af31b521a90c2a
tree128329e66c8f8b2e0ea84763be364a1b86871f58
parentd03adb4a78d18b5506350b3ac72ab2f18f1ed160
dm: core: Add a new sequence number for devices

At present each device has two sequence numbers, with 'req_seq' being
set up at bind time and 'seq' at probe time. The idea is that devices
can 'request' a sequence number and then the conflicts are resolved when
the device is probed.

This makes things complicated in a few cases, since we don't really know
what the sequence number will end up being. We want to honour the
bind-time requests if at all possible, but in fact the only source of
these at present is the devicetree aliases. Since we have the devicetree
available at bind time, we may as well just use it, in the hope that the
required processing will turn out to be useful later (i.e. the device
actually gets used).

Add a new 'sqq' member, the bind-time sequence number. It operates in
parallel to the old values for now. All devices get a valid sqq value,
i.e. it is never -1.

Drop an #ifdef while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/device.c
drivers/core/root.c
include/dm/device.h