device/device.h: Rename busses for clarity

This renames bus to upstream and link_list to downstream.

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I80a81b6b8606e450ff180add9439481ec28c2420
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78330
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/drivers/i2c/ptn3460/ptn3460.c b/src/drivers/i2c/ptn3460/ptn3460.c
index 93acb18..76b3bc8 100644
--- a/src/drivers/i2c/ptn3460/ptn3460.c
+++ b/src/drivers/i2c/ptn3460/ptn3460.c
@@ -172,8 +172,8 @@
 		return;
 	}
 	/* Initialize the I2C controller before it is used. */
-	if (ptn_dev->bus && ptn_dev->bus->dev->ops && ptn_dev->bus->dev->ops->init)
-		ptn_dev->bus->dev->ops->init(ptn_dev->bus->dev);
+	if (ptn_dev->upstream && ptn_dev->upstream->dev->ops && ptn_dev->upstream->dev->ops->init)
+		ptn_dev->upstream->dev->ops->init(ptn_dev->upstream->dev);
 	ptn3460_init(ptn_dev);
 }
 
diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c
index bceb0de..f313540 100644
--- a/src/drivers/intel/dptf/dptf.c
+++ b/src/drivers/intel/dptf/dptf.c
@@ -503,7 +503,7 @@
 	enum dptf_participant p;
 
 	/* The CPU device gets an _ADR that matches the ACPI PCI address for 00:04.00 */
-	parent = dev && dev->bus ? dev->bus->dev : NULL;
+	parent = dev && dev->upstream ? dev->upstream->dev : NULL;
 	if (!parent || parent->path.type != DEVICE_PATH_PCI) {
 		printk(BIOS_ERR, "%s: DPTF objects must live under 00:04.0 PCI device\n",
 		       __func__);
diff --git a/src/drivers/intel/ish/ish.c b/src/drivers/intel/ish/ish.c
index 6dba46a..0ad0bb8 100644
--- a/src/drivers/intel/ish/ish.c
+++ b/src/drivers/intel/ish/ish.c
@@ -12,7 +12,7 @@
 static void ish_fill_ssdt_generator(const struct device *dev)
 {
 	struct drivers_intel_ish_config *config = dev->chip_info;
-	struct device *root = dev->bus->dev;
+	struct device *root = dev->upstream->dev;
 	struct acpi_dp *dsd;
 
 	if (!config)
diff --git a/src/drivers/intel/mipi_camera/camera.c b/src/drivers/intel/mipi_camera/camera.c
index 77c86ea..4044a26 100644
--- a/src/drivers/intel/mipi_camera/camera.c
+++ b/src/drivers/intel/mipi_camera/camera.c
@@ -199,7 +199,7 @@
 static uint32_t address_for_dev_type(const struct device *dev, uint8_t dev_type)
 {
 	struct drivers_intel_mipi_camera_config *config = dev->chip_info;
-	uint16_t i2c_bus = dev->bus ? dev->bus->secondary : 0xFFFF;
+	uint16_t i2c_bus = dev->upstream ? dev->upstream->secondary : 0xFFFF;
 	uint16_t i2c_addr;
 
 	switch (dev_type) {
@@ -416,7 +416,7 @@
 				.type = DEVICE_PATH_I2C,
 				.i2c.device = config->vcm_address,
 			};
-			struct device *vcm_dev = find_dev_path(dev->bus, &path);
+			struct device *vcm_dev = find_dev_path(dev->upstream, &path);
 			struct drivers_intel_mipi_camera_config *vcm_config;
 			vcm_config = vcm_dev ? vcm_dev->chip_info : NULL;
 
@@ -927,7 +927,7 @@
 	const struct device *pdev;
 
 	if (config->has_power_resource) {
-		pdev = dev->bus->dev;
+		pdev = dev->upstream->dev;
 		if (!pdev || !pdev->enabled)
 			return;
 
@@ -951,7 +951,7 @@
 		write_i2c_camera_device(dev, scope);
 		break;
 	case DEVICE_PATH_GENERIC:
-		pdev = dev->bus->dev;
+		pdev = dev->upstream->dev;
 		scope = acpi_device_scope(pdev);
 		if (!scope)
 			return;
diff --git a/src/drivers/intel/soundwire/soundwire.c b/src/drivers/intel/soundwire/soundwire.c
index f9421fc..0137dad 100644
--- a/src/drivers/intel/soundwire/soundwire.c
+++ b/src/drivers/intel/soundwire/soundwire.c
@@ -21,7 +21,7 @@
 {
 	struct device *child;
 
-	for (child = dev->link_list->children; child; child = child->sibling) {
+	for (child = dev->downstream->children; child; child = child->sibling) {
 		if (child->enabled && child->path.type == DEVICE_PATH_GENERIC &&
 		    child->path.generic.id == link)
 			return true;
diff --git a/src/drivers/net/phy/m88e1512/m88e1512.c b/src/drivers/net/phy/m88e1512/m88e1512.c
index 07110c6..7e67500 100644
--- a/src/drivers/net/phy/m88e1512/m88e1512.c
+++ b/src/drivers/net/phy/m88e1512/m88e1512.c
@@ -21,10 +21,10 @@
 	if (config->downshift_cnt) {
 		if (config->downshift_cnt > DOWNSHIFT_CNT_MAX) {
 			printk(BIOS_INFO, "%s: Downshift counter for %s is too large.\n",
-					dev_path(dev->bus->dev), dev->chip_ops->name);
+					dev_path(dev->upstream->dev), dev->chip_ops->name);
 		} else {
 			printk(BIOS_DEBUG, "%s: Enable downshift after %d attempts for %s.\n",
-					dev_path(dev->bus->dev), config->downshift_cnt,
+					dev_path(dev->upstream->dev), config->downshift_cnt,
 					dev->chip_ops->name);
 
 			reg = mdio_read(dev, COPPER_SPEC_CTRL_REG_1);
@@ -42,7 +42,7 @@
 	/* Configure LEDs if requested. */
 	if (config->configure_leds) {
 		printk(BIOS_DEBUG, "%s: Set a customized LED mode for %s.\n",
-				dev_path(dev->bus->dev), dev->chip_ops->name);
+				dev_path(dev->upstream->dev), dev->chip_ops->name);
 
 		/* Select page 3 to access LED function control register. */
 		switch_page(dev, 3);
@@ -57,7 +57,7 @@
 	/* INTn can be routed to LED[2] pin. */
 	if (config->enable_int) {
 		printk(BIOS_DEBUG, "%s: INTn is routed to LED[2] pin %s.\n",
-				dev_path(dev->bus->dev), dev->chip_ops->name);
+				dev_path(dev->upstream->dev), dev->chip_ops->name);
 
 		/* Select page 3 to access LED function control register. */
 		switch_page(dev, 3);
@@ -70,7 +70,7 @@
 	/* Set RGMII output impedance manually. */
 	if (config->force_mos) {
 		printk(BIOS_DEBUG, "%s: Set RGMII driver strength manually for %s.\n",
-				dev_path(dev->bus->dev), dev->chip_ops->name);
+				dev_path(dev->upstream->dev), dev->chip_ops->name);
 
 		/* Select page 2 to access RGMII output impedance calibration override
 		   register. */
diff --git a/src/drivers/net/r8168.c b/src/drivers/net/r8168.c
index 70a0f63..6d93ed2 100644
--- a/src/drivers/net/r8168.c
+++ b/src/drivers/net/r8168.c
@@ -364,7 +364,7 @@
 static void r8168_net_fill_ssdt(const struct device *dev)
 {
 	struct drivers_net_config *config = dev->chip_info;
-	const char *path = acpi_device_path(dev->bus->dev);
+	const char *path = acpi_device_path(dev->upstream->dev);
 	u32 address;
 
 	if (!path || !config)
diff --git a/src/drivers/nxp/uwb/uwb.c b/src/drivers/nxp/uwb/uwb.c
index 0f5ba47..b828657 100644
--- a/src/drivers/nxp/uwb/uwb.c
+++ b/src/drivers/nxp/uwb/uwb.c
@@ -15,10 +15,10 @@
 	struct device *spi_dev;
 	struct device_operations *ops;
 
-	if (!dev->bus || !dev->bus->dev)
+	if (!dev->upstream || !dev->upstream->dev)
 		return -1;
 
-	spi_dev = dev->bus->dev;
+	spi_dev = dev->upstream->dev;
 	ops = spi_dev->ops;
 
 	if (ops && ops->ops_spi_bus && ops->ops_spi_bus->dev_to_bus)
diff --git a/src/drivers/pcie/generic/generic.c b/src/drivers/pcie/generic/generic.c
index 1b7976e..e401261 100644
--- a/src/drivers/pcie/generic/generic.c
+++ b/src/drivers/pcie/generic/generic.c
@@ -27,13 +27,13 @@
 	pci_rom_ssdt(dev);
 
 	config = dev->chip_info;
-	if (!config || !dev->bus || !dev->bus->dev)
+	if (!config || !dev->upstream || !dev->upstream->dev)
 		return;
 
 	const char *scope;
 	const char *name;
 
-	scope = acpi_device_path(dev->bus->dev);
+	scope = acpi_device_path(dev->upstream->dev);
 	name = acpi_device_name(dev);
 
 	acpigen_write_scope(scope);
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c
index b58bc2d..537c377 100644
--- a/src/drivers/spi/acpi/acpi.c
+++ b/src/drivers/spi/acpi/acpi.c
@@ -15,10 +15,10 @@
 	struct device *spi_dev;
 	struct device_operations *ops;
 
-	if (!dev->bus || !dev->bus->dev)
+	if (!dev->upstream || !dev->upstream->dev)
 		return -1;
 
-	spi_dev = dev->bus->dev;
+	spi_dev = dev->upstream->dev;
 	ops = spi_dev->ops;
 
 	if (ops && ops->ops_spi_bus &&
diff --git a/src/drivers/usb/hub/acpi.c b/src/drivers/usb/hub/acpi.c
index e26d584..3944952 100644
--- a/src/drivers/usb/hub/acpi.c
+++ b/src/drivers/usb/hub/acpi.c
@@ -41,7 +41,7 @@
 	struct device *port = NULL;
 	unsigned int child_count = 0;
 
-	while ((port = dev_bus_each_child(dev->link_list, port)) != NULL) {
+	while ((port = dev_bus_each_child(dev->downstream, port)) != NULL) {
 		if (child_count++ >= config->port_count) {
 			printk(BIOS_WARNING, "%s cannot be added. Port Count limit reached.\n",
 			       dev_name(port));
diff --git a/src/drivers/usb/pci_xhci/pci_xhci.c b/src/drivers/usb/pci_xhci/pci_xhci.c
index 398595d..47f69c0 100644
--- a/src/drivers/usb/pci_xhci/pci_xhci.c
+++ b/src/drivers/usb/pci_xhci/pci_xhci.c
@@ -76,7 +76,7 @@
 		if (is_root_device(dev))
 			return NULL;
 
-		dev = dev->bus->dev;
+		dev = dev->upstream->dev;
 	}
 
 	return dev;
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c
index f37a084..6abad83 100644
--- a/src/drivers/wifi/generic/acpi.c
+++ b/src/drivers/wifi/generic/acpi.c
@@ -610,7 +610,7 @@
 	if (!dev)
 		return;
 
-	path = acpi_device_path(dev->bus->dev);
+	path = acpi_device_path(dev->upstream->dev);
 	if (!path)
 		return;
 
diff --git a/src/drivers/wifi/generic/smbios.c b/src/drivers/wifi/generic/smbios.c
index 82c96a5..e6ccd5d 100644
--- a/src/drivers/wifi/generic/smbios.c
+++ b/src/drivers/wifi/generic/smbios.c
@@ -38,5 +38,5 @@
 
 int smbios_write_wifi_cnvi(struct device *dev, int *handle, unsigned long *current)
 {
-	return smbios_write_wifi_pcie(dev->bus->dev, handle, current);
+	return smbios_write_wifi_pcie(dev->upstream->dev, handle, current);
 }
diff --git a/src/drivers/wwan/fm/acpi_fm350gl.c b/src/drivers/wwan/fm/acpi_fm350gl.c
index 77ff085..564ac03 100644
--- a/src/drivers/wwan/fm/acpi_fm350gl.c
+++ b/src/drivers/wwan/fm/acpi_fm350gl.c
@@ -317,7 +317,7 @@
 static void wwan_fm350gl_acpi_fill_ssdt(const struct device *dev)
 {
 	const struct drivers_wwan_fm_config *config = config_of(dev);
-	const struct device *parent = dev->bus->dev;
+	const struct device *parent = dev->upstream->dev;
 	const char *scope = acpi_device_path(parent);
 	const struct soc_intel_common_block_pcie_rtd3_config *rtd3_config;