aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-04-18 00:44:42 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-04-22 13:26:02 +0000
commit101685de0c1a61f8940d007abcacfa5cc4291791 (patch)
tree80e59d47d058c9d7bff5e7343070213c299cfdf8 /src/device
parent48097a17f151bf3843bd921391125ba8de56ac65 (diff)
device_util: Handle domain device in dev_get_domain
When the input device pointer pointing to a domain device, dev_get_domain returns the input device itself. TEST=Build and boot on intel/archercity CRB Change-Id: I3a278a8f573de95406ee256fba17767def4ad75d Signed-off-by: Shuo Liu <shuo.liu@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81957 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 5e353c2734..7dcf081820 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -252,9 +252,9 @@ const struct device *dev_get_domain(const struct device *dev)
{
/* Walk up the tree up to the domain */
while (dev && dev->upstream && !is_root_device(dev)) {
- dev = dev->upstream->dev;
if (dev->path.type == DEVICE_PATH_DOMAIN)
return dev;
+ dev = dev->upstream->dev;
}
return NULL;