diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2024-01-25 22:26:07 +0100 |
---|---|---|
committer | Arthur Heymans <arthur@aheymans.xyz> | 2024-01-29 15:04:18 +0000 |
commit | 3e99ba02a40cb1035c9ed22552cfc22aaf6bda7d (patch) | |
tree | b2a03e9da5ac03153aedc8bb43586739d53be6af /src/include/device | |
parent | e4e26560ee70d4215cbfb5f24cbbc9283177c4d9 (diff) |
device: Add a helper function to add a downstream bus
Adding downstream busses at runtime is a common pattern so add a helper
function.
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: Ic898189b92997b93304fcbf47c73e2bb5ec09023
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80210
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/include/device')
-rw-r--r-- | src/include/device/device.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index 83588d4735..13bc8dcb34 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -171,6 +171,7 @@ extern struct bus *free_links; /* Generic device interface functions */ struct device *alloc_dev(struct bus *parent, struct device_path *path); +struct bus *alloc_bus(struct device *parent); void dev_initialize_chips(void); void dev_enumerate(void); void dev_configure(void); @@ -229,10 +230,9 @@ void mp_init_cpus(DEVTREE_CONST struct bus *cpu_bus); static inline void mp_cpu_bus_init(struct device *dev) { /* Make sure the cpu cluster has a downstream bus for LAPICs to be allocated. */ - if (!dev->link_list) - add_more_links(dev, 1); + struct bus *bus = alloc_bus(dev); - mp_init_cpus(dev->link_list); + mp_init_cpus(bus); } /* Debug functions */ |