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/southbridge/amd/pi/hudson/lpc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/southbridge/amd/pi') diff --git a/src/southbridge/amd/pi/hudson/lpc.c b/src/southbridge/amd/pi/hudson/lpc.c index 0a4e038385..266d75c589 100644 --- a/src/southbridge/amd/pi/hudson/lpc.c +++ b/src/southbridge/amd/pi/hudson/lpc.c @@ -134,7 +134,6 @@ static void hudson_lpc_set_resources(struct device *dev) */ static void hudson_lpc_enable_childrens_resources(struct device *dev) { - struct bus *link; u32 reg, reg_x; int var_num = 0; u16 reg_var[3]; @@ -171,12 +170,10 @@ static void hudson_lpc_enable_childrens_resources(struct device *dev) reg_var[1] = pci_read_config16(dev, 0x66); reg_var[0] = pci_read_config16(dev, 0x64); - for (link = dev->link_list; link; link = link->next) { - struct device *child; - for (child = link->children; child; - child = child->sibling) { - if (child->enabled - && (child->path.type == DEVICE_PATH_PNP)) { + struct device *child; + if (dev->link_list) { + for (child = dev->link_list->children; child; child = child->sibling) { + if (child->enabled && (child->path.type == DEVICE_PATH_PNP)) { struct resource *res; for (res = child->resource_list; res; res = res->next) { u32 base, end; /* don't need long long */ -- cgit v1.2.3