diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-07-11 09:25:33 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-07-26 11:30:56 +0300 |
commit | de84a4f0eed297afa752ee46c072a99834dde806 (patch) | |
tree | 0aa6851ee572cb92e3dc5a1edc90baed24ed3779 | |
parent | 9396116d2d1d6d87a8d96f2c4b50ae1019d6cdf0 (diff) | |
download | u-boot-de84a4f0eed297afa752ee46c072a99834dde806.tar.xz |
dm: fix logic of lists_bind_fdt()
If parameter drv of lists_bind_fdt() is specified, we shall bind only to
this very driver and to no other.
If the driver drv has an of_match property, we shall only bind to the
driver if it matches the compatible string of the device.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | drivers/core/lists.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 93514a744d..c49695b24f 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -223,10 +223,14 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, compat); for (entry = driver; entry != driver + n_ents; entry++) { + if (drv) { + if (drv != entry) + continue; + if (!entry->of_match) + break; + } ret = driver_check_compatible(entry->of_match, &id, compat); - if ((drv) && (drv == entry)) - break; if (!ret) break; } |