From 101685de0c1a61f8940d007abcacfa5cc4291791 Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Thu, 18 Apr 2024 00:44:42 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/81957 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/device/device_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/device') 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; -- cgit v1.2.3