summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-31 17:59:32 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-10-08 13:57:41 +0800
commitbe0d8fa452a4b6ed09a4228980052c35ef7331e0 (patch)
treeca2ab0d1f9c1daa20acde33787fdc9a102616c90
parent9b69ba4a787209da59e69fd4e411ab6561b0447f (diff)
pci: sandbox: Probe PCI emulation devices when used
At present PCI emulation devices are not probed before use, since they used to be children of the device that used them, and children cannot be probed before their parents. Now that PCI emulation devices are attached to the root node, we can simply probe them, and avoid using the internal function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: rebase the patch against u-boot-x86/next to get it applied cleanly] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--drivers/pci/pci-emul-uclass.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pci/pci-emul-uclass.c b/drivers/pci/pci-emul-uclass.c
index 6b4efcea37..fd87b3ea4e 100644
--- a/drivers/pci/pci-emul-uclass.c
+++ b/drivers/pci/pci-emul-uclass.c
@@ -10,7 +10,6 @@
#include <linux/libfdt.h>
#include <pci.h>
#include <dm/lists.h>
-#include <dm/uclass-internal.h>
struct sandbox_pci_emul_priv {
int dev_count;
@@ -35,8 +34,8 @@ int sandbox_pci_get_emul(struct udevice *bus, pci_dev_t find_devfn,
* See commit 4345998ae9df,
* "pci: sandbox: Support dynamically binding device driver"
*/
- ret = uclass_find_device_by_phandle(UCLASS_PCI_EMUL, dev,
- "sandbox,emul", emulp);
+ ret = uclass_get_device_by_phandle(UCLASS_PCI_EMUL, dev, "sandbox,emul",
+ emulp);
if (ret && device_get_uclass_id(dev) != UCLASS_PCI_GENERIC)
*emulp = dev;