From 61ed4ef5d50137886449086f7bf2052468f99f29 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Sep 2022 14:55:53 +0200 Subject: treewide: use predicate to check if pci device is on n-th bus use function to check if pci device is on a particular bus number. TEST: compiled and qemu run successfully Signed-off-by: Fabio Aiuto Change-Id: I4a3e96381c29056de71953ea2c39cd540f3df191 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68103 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/northbridge/intel/gm45/northbridge.c | 2 +- src/northbridge/intel/haswell/northbridge.c | 2 +- src/northbridge/intel/i945/northbridge.c | 2 +- src/northbridge/intel/ironlake/northbridge.c | 2 +- src/northbridge/intel/pineview/northbridge.c | 2 +- src/northbridge/intel/x4x/northbridge.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/northbridge') diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c index 1078748de6..df5526c244 100644 --- a/src/northbridge/intel/gm45/northbridge.c +++ b/src/northbridge/intel/gm45/northbridge.c @@ -159,7 +159,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c index 8465561f5d..e84ba76b95 100644 --- a/src/northbridge/intel/haswell/northbridge.c +++ b/src/northbridge/intel/haswell/northbridge.c @@ -23,7 +23,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c index 12debb2b32..3c5603c90f 100644 --- a/src/northbridge/intel/i945/northbridge.c +++ b/src/northbridge/intel/i945/northbridge.c @@ -101,7 +101,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { diff --git a/src/northbridge/intel/ironlake/northbridge.c b/src/northbridge/intel/ironlake/northbridge.c index af602f1e76..fbad6d40a7 100644 --- a/src/northbridge/intel/ironlake/northbridge.c +++ b/src/northbridge/intel/ironlake/northbridge.c @@ -63,7 +63,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { diff --git a/src/northbridge/intel/pineview/northbridge.c b/src/northbridge/intel/pineview/northbridge.c index 3afdd3ba98..7e29db92b3 100644 --- a/src/northbridge/intel/pineview/northbridge.c +++ b/src/northbridge/intel/pineview/northbridge.c @@ -145,7 +145,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { diff --git a/src/northbridge/intel/x4x/northbridge.c b/src/northbridge/intel/x4x/northbridge.c index cdf43c95e6..ac276b69d4 100644 --- a/src/northbridge/intel/x4x/northbridge.c +++ b/src/northbridge/intel/x4x/northbridge.c @@ -123,7 +123,7 @@ static const char *northbridge_acpi_name(const struct device *dev) if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0"; - if (dev->path.type != DEVICE_PATH_PCI || dev->bus->secondary != 0) + if (!is_pci_dev_on_bus(dev, 0)) return NULL; switch (dev->path.pci.devfn) { -- cgit v1.2.3