From d7a244f923dcdd383b5eefaf7a412493fe977b79 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Tue, 28 May 2019 15:30:06 +0800 Subject: [PATCH] core: device_bind_common: only delete U-Boot existance node Use "u-boot,dm-pre-reloc" to identify whether the existance node is from U-Boot or not. This avoids deleting the same name nodes from kernel dtb. Change-Id: I6503965c0013053feefad7e93f98b01b5af71f44 Signed-off-by: Joseph Chen --- drivers/core/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 21eb2527a0..5d7ec56c82 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -69,7 +69,8 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, struct udevice *n; list_for_each_entry_safe(dev, n, &uc->dev_head, uclass_node) { - if (!strcmp(name, dev->name)) { + if (!strcmp(name, dev->name) && + dev_read_bool(dev, "u-boot,dm-pre-reloc")) { if (drv->id == UCLASS_SERIAL) { /* Always use serial node from U-Boot dtb */ debug("%s do not delete uboot dev: %s\n",