/* Use a MISC device to bind the n instances (child nodes) of the PCIe base controller in UCLASS_PCI.  */
static int mvebu_pcie_bind(struct udevice *parent)
/* Use a MISC device to bind the n instances (child nodes) of the PCIe base controller in UCLASS_PCI.  */
static int mvebu_pcie_bind(struct udevice *parent)
{
	struct mvebu_pcie *pcie;
	struct uclass_driver *drv;
	struct udevice *dev;
	ofnode subnode;
	drv = lists_uclass_lookup(UCLASS_PCI);
	if (!drv) {
		puts("Cannot find PCI driver\n");
		return -ENOENT;
	}
	ofnode_for_each_subnode(subnode, dev_ofnode(parent)) {
		if (!ofnode_is_available(subnode))
			continue;
		pcie = calloc(1, sizeof(*pcie));
		if (!pcie)
			return -ENOMEM;
		device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie,
				   subnode, &dev);
	}
	return 0;
}