From 80c79a5dc31cca9f157cd2f35f435dfa7648ce11 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 24 Aug 2023 15:12:19 +0200 Subject: device/device.h: Drop multiple links Multiple links are unused throughout the tree and make the code more confusing as an iteration over all busses is needed to get downstream devices. This also not done consistently e.g. the allocator does not care about multiple links on busses. A better way of dealing multiple links below a device is to feature dummy devices with each their respective bus. This drops the sconfig capability to declare the same device multiple times which was previously used to declare multiple links. Signed-off-by: Arthur Heymans Change-Id: Iab6fe269faef46ae77ed1ea425440cf5c7dbd49b Reviewed-on: https://review.coreboot.org/c/coreboot/+/78328 Reviewed-by: Felix Held Tested-by: build bot (Jenkins) Reviewed-by: Jincheng Li Reviewed-by: Lean Sheng Tan --- src/device/pci_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/device/pci_device.c') diff --git a/src/device/pci_device.c b/src/device/pci_device.c index acdad421c536..24b95238f134 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -713,16 +713,13 @@ static void pci_set_resource(struct device *dev, struct resource *resource) void pci_dev_set_resources(struct device *dev) { struct resource *res; - struct bus *bus; u8 line; for (res = dev->resource_list; res; res = res->next) pci_set_resource(dev, res); - for (bus = dev->link_list; bus; bus = bus->next) { - if (bus->children) - assign_resources(bus); - } + if (dev->link_list && dev->link_list->children) + assign_resources(dev->link_list); /* Set a default latency timer. */ pci_write_config8(dev, PCI_LATENCY_TIMER, 0x40); -- cgit v1.2.3