mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
um: virt-pci: implement pcibios_get_phb_of_node()
Implement pcibios_get_phb_of_node() as x86 does in order to allow PCI busses to be associated with devicetree nodes. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
83e913f52a
commit
314a1408b7
1 changed files with 19 additions and 0 deletions
|
@ -533,6 +533,25 @@ static void um_pci_irq_vq_cb(struct virtqueue *vq)
|
|||
}
|
||||
}
|
||||
|
||||
/* Copied from arch/x86/kernel/devicetree.c */
|
||||
struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
for_each_node_by_type(np, "pci") {
|
||||
const void *prop;
|
||||
unsigned int bus_min;
|
||||
|
||||
prop = of_get_property(np, "bus-range", NULL);
|
||||
if (!prop)
|
||||
continue;
|
||||
bus_min = be32_to_cpup(prop);
|
||||
if (bus->number == bus_min)
|
||||
return np;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int um_pci_init_vqs(struct um_pci_device *dev)
|
||||
{
|
||||
struct virtqueue *vqs[2];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue