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>
This commit is contained in:
Fabio Aiuto 2022-09-30 14:55:53 +02:00 committed by Martin Roth
parent d835da9155
commit 61ed4ef5d5
7 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {