summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/northbridge.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-12-20 22:47:03 +0100
committerShelley Chen <shchen@google.com>2023-12-26 17:09:30 +0000
commit727ee667561909ecb05a2671bd7d885aa111cd60 (patch)
treee3b055cb162579545c54dba54b868f7453fc17a4 /src/soc/amd/stoneyridge/northbridge.c
parent1b60e5c5c92e96b11a87d2649a0045bb451d9de1 (diff)
soc/amd/stoneyridge: use is_dev_enabled(DEV_PTR())
Since we have chipset devicetrees for both SoCs supported by the Stoneyridge code, we can use the DEV_PTR macro instead of using pcidev_path_on_root to get the device struct pointer. We can also use the is_dev_enabled function instead of checking the value of the enabled element of the device struct directly. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ifb787750ebc6aa2fef9d3be0e84e6afcffdc2ac1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79671 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/stoneyridge/northbridge.c')
-rw-r--r--src/soc/amd/stoneyridge/northbridge.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index ef53b2ed3b..bf2f992e33 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -322,8 +322,7 @@ __weak void set_board_env_params(GNB_ENV_CONFIGURATION *params) { }
void SetNbEnvParams(GNB_ENV_CONFIGURATION *params)
{
- const struct device *dev = SOC_IOMMU_DEV;
- params->IommuSupport = dev && dev->enabled;
+ params->IommuSupport = is_dev_enabled(DEV_PTR(iommu));
set_board_env_params(params);
}