To avoid having constructs like 'dev->path.domain.domain' in the SoC code, create the 'dev_get_domain_id' helper function that returns the domain ID of either that device if it's a domain device or the corresponding domain device's domain ID, and use it in the code. If this function is called with a device other than PCI or domain type, it won't have a domain number. In order to not need to call 'die', 'dev_get_domain_id' will print an error and return 0 which is a valid domain number. In that case, the calling code should be fixed. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I3d79f19846cea49609f848a4c42747ac1052c288 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83644 Reviewed-by: Shuo Liu <shuo.liu@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> |
||
|---|---|---|
| .. | ||
| dram | ||
| azalia_device.h | ||
| cardbus.h | ||
| device.h | ||
| gpio.h | ||
| i2c.h | ||
| i2c_bus.h | ||
| i2c_simple.h | ||
| mdio.h | ||
| mmio.h | ||
| path.h | ||
| pci.h | ||
| pci_def.h | ||
| pci_ehci.h | ||
| pci_ids.h | ||
| pci_mmio_cfg.h | ||
| pci_ops.h | ||
| pci_rom.h | ||
| pci_type.h | ||
| pciexp.h | ||
| pcix.h | ||
| pnp.h | ||
| pnp_def.h | ||
| pnp_ops.h | ||
| pnp_type.h | ||
| resource.h | ||
| smbus.h | ||
| smbus_def.h | ||
| smbus_host.h | ||
| soundwire.h | ||
| spi.h | ||
| usbc_mux.h | ||
| xhci.h | ||