On Mon, Jun 04, 2012 at 10:18:46PM -0700, Yinghai Lu wrote: >On Mon, Jun 4, 2012 at 9:37 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote: >> That's true, but I don't think it answers the question. If we have: >> >> pci_bus->bridge == pci_bus->self->dev >> >> why would we need both "self" and "bridge"? It would be interesting >> to try to remove "bridge" and replace uses of it with "self->dev". > >then how about root bus? > >root bus ->self should be NULL. > >root bus ->bridge is to the hostbridge->dev. > >Yinghai Agree, root_pci_bus->self is NULL, and root_pci_bus->bridge point to a solo device structure, not in hostbridge. BTW, if the dev is the hostbrige->dev, why not pci_host_bridge contain a field "dev"? And, why root bus differs with other bus a lot? Both root bus and other bus use self/bridge point to the "PCI BRIDGE" device. I think we can determine whether this is a root bus by bus->parent? -- Richard Yang Help you, Help me -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html