From 7fcd4d58ec7ea2da31c258ba9d8601f086d7f8d8 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 24 Aug 2023 15:12:19 +0200 Subject: device/device.h: Rename busses for clarity This renames bus to upstream and link_list to downstream. Signed-off-by: Arthur Heymans Change-Id: I80a81b6b8606e450ff180add9439481ec28c2420 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78330 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/include/device/device.h | 13 ++++--------- src/include/device/pci_ops.h | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/include/device') diff --git a/src/include/device/device.h b/src/include/device/device.h index 7e52f41a14..27ef82a8d7 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -95,8 +95,8 @@ struct bus { */ struct device { - DEVTREE_CONST struct bus *bus; /* bus this device is on, for bridge - * devices, it is the up stream bus */ + DEVTREE_CONST struct bus *upstream; + DEVTREE_CONST struct bus *downstream; DEVTREE_CONST struct device *sibling; /* next device on this bus */ @@ -124,11 +124,6 @@ struct device { /* Base registers for this device. I/O, MEM and Expansion ROM */ DEVTREE_CONST struct resource *resource_list; - /* links are (downstream) buses attached to the device, usually a leaf - * device with no children has 0 buses attached and a bridge has 1 bus - */ - DEVTREE_CONST struct bus *link_list; - #if !DEVTREE_EARLY struct device_operations *ops; struct chip_operations *chip_ops; @@ -458,11 +453,11 @@ static inline DEVTREE_CONST void *config_of(const struct device *dev) static inline bool is_root_device(const struct device *dev) { - if (!dev || !dev->bus) + if (!dev || !dev->upstream) return false; return (dev->path.type == DEVICE_PATH_ROOT) || - (dev->bus->dev == dev); + (dev->upstream->dev == dev); } void enable_static_device(struct device *dev); diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index de5f913566..90c59fb2a0 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -12,8 +12,8 @@ void __noreturn pcidev_die(void); static __always_inline pci_devfn_t pcidev_bdf(const struct device *dev) { - return (dev->path.pci.devfn << 12) | (dev->bus->secondary << 20) | - (dev->bus->segment_group << 28); + return (dev->path.pci.devfn << 12) | (dev->upstream->secondary << 20) | + (dev->upstream->segment_group << 28); } static __always_inline pci_devfn_t pcidev_assert(const struct device *dev) -- cgit v1.2.3