From: Bin Meng Date: Sun, 23 Aug 2015 01:32:59 -0700 Subject: [U-Boot] [PATCH v3 2/4] dm: core: Test dev->flags after device_probe() in device_probe_child() In-Reply-To: <1440318781-11321-1-git-send-email-bmeng.cn@gmail.com> References: <1440318781-11321-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1440318781-11321-3-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The device might have already been probed during the call to device_probe() on its parent device (e.g. PCI bridge devices). Test the flags again so that we don't mess up the device. Signed-off-by: Bin Meng --- Changes in v3: None drivers/core/device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/core/device.c b/drivers/core/device.c index e23a872..7a62812 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -266,6 +266,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv) goto fail; } + /* + * The device might have already been probed during the call to + * device_probe() on its parent device (e.g. PCI bridge devices). + * Test the flags again so that we don't mess up the device. + */ + if (dev->flags & DM_FLAG_ACTIVATED) + return 0; + seq = uclass_resolve_seq(dev); if (seq < 0) { ret = seq; -- 1.8.2.1