summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Aiuto <fabioaiuto83@gmail.com>2022-09-30 14:55:53 +0200
committerMartin Roth <martin.roth@amd.corp-partner.google.com>2022-10-06 18:35:03 +0000
commit61ed4ef5d50137886449086f7bf2052468f99f29 (patch)
tree0fc7c9a566e32754c8a614ffe10fa19669dd58c6
parentd835da91552bc74892dce7b9d2aafb74ce86b1f2 (diff)
downloadcoreboot-61ed4ef5d50137886449086f7bf2052468f99f29.tar.gz
coreboot-61ed4ef5d50137886449086f7bf2052468f99f29.tar.bz2
coreboot-61ed4ef5d50137886449086f7bf2052468f99f29.zip
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 <fabioaiuto83@gmail.com> Change-Id: I4a3e96381c29056de71953ea2c39cd540f3df191 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68103 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/emulation/qemu-i440fx/northbridge.c2
-rw-r--r--src/northbridge/intel/gm45/northbridge.c2
-rw-r--r--src/northbridge/intel/haswell/northbridge.c2
-rw-r--r--src/northbridge/intel/i945/northbridge.c2
-rw-r--r--src/northbridge/intel/ironlake/northbridge.c2
-rw-r--r--src/northbridge/intel/pineview/northbridge.c2
-rw-r--r--src/northbridge/intel/x4x/northbridge.c2
7 files changed, 7 insertions, 7 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index 07f345af4d6d..957837ef23ff 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -219,7 +219,7 @@ static const char *qemu_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;
return NULL;
diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c
index 1078748de655..df5526c24464 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 8465561f5de1..e84ba76b9544 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 12debb2b32a4..3c5603c90fc5 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 af602f1e76df..fbad6d40a71d 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 3afdd3ba986c..7e29db92b3dd 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 cdf43c95e63b..ac276b69d4a0 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) {