diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-17 07:20:07 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-12-19 06:32:21 +0300 |
commit | 8b85dfc675f12de8d04126c07f3c796965b990c2 (patch) | |
tree | 9b8d6df956b02734a1b910b0a4c072e1e80b672a /drivers/core/uclass.c | |
parent | 0b2fa98aa5e5dbdac4f5e2b2f67a34cc34dcc6b8 (diff) | |
download | u-boot-8b85dfc675f12de8d04126c07f3c796965b990c2.tar.xz |
dm: Avoid accessing seq directly
At present various drivers etc. access the device's 'seq' member directly.
This makes it harder to change the meaning of that member. Change access
to go through a function instead.
The drivers/i2c/lpc32xx_i2c.c file is left unchanged for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r-- | drivers/core/uclass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index b1d882e14e..e2372c65d2 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -311,8 +311,8 @@ int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq, uclass_foreach_dev(dev, uc) { log_debug(" - %d %d '%s'\n", - dev->req_seq, dev->seq, dev->name); - if ((find_req_seq ? dev->req_seq : dev->seq) == + dev->req_seq, dev_seq(dev), dev->name); + if ((find_req_seq ? dev->req_seq : dev_seq(dev)) == seq_or_req_seq) { *devp = dev; log_debug(" - found\n"); @@ -695,7 +695,7 @@ int uclass_resolve_seq(struct udevice *dev) int seq = 0; int ret; - assert(dev->seq == -1); + assert(dev_seq(dev) == -1); ret = uclass_find_device_by_seq(uc_drv->id, dev->req_seq, false, &dup); if (!ret) { dm_warn("Device '%s': seq %d is in use by '%s'\n", |