From 727ee667561909ecb05a2671bd7d885aa111cd60 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 20 Dec 2023 22:47:03 +0100 Subject: 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 Change-Id: Ifb787750ebc6aa2fef9d3be0e84e6afcffdc2ac1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79671 Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- src/soc/amd/stoneyridge/fch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/soc/amd/stoneyridge/fch.c') diff --git a/src/soc/amd/stoneyridge/fch.c b/src/soc/amd/stoneyridge/fch.c index 176c263c17..3013500fa9 100644 --- a/src/soc/amd/stoneyridge/fch.c +++ b/src/soc/amd/stoneyridge/fch.c @@ -125,8 +125,6 @@ void fch_init(void *chip_info) static void set_sb_aoac(struct aoac_devs *aoac) { - const struct device *sd, *sata; - aoac->ic0e = is_aoac_device_enabled(FCH_AOAC_DEV_I2C0); aoac->ic1e = is_aoac_device_enabled(FCH_AOAC_DEV_I2C1); aoac->ic2e = is_aoac_device_enabled(FCH_AOAC_DEV_I2C2); @@ -137,10 +135,8 @@ static void set_sb_aoac(struct aoac_devs *aoac) aoac->xhce = is_aoac_device_enabled(FCH_AOAC_DEV_USB3); /* Rely on these being in sync with devicetree */ - sd = pcidev_path_on_root(SD_DEVFN); - aoac->sd_e = sd && sd->enabled ? 1 : 0; - sata = pcidev_path_on_root(SATA_DEVFN); - aoac->st_e = sata && sata->enabled ? 1 : 0; + aoac->sd_e = is_dev_enabled(DEV_PTR(sdhci)) ? 1 : 0; + aoac->st_e = is_dev_enabled(DEV_PTR(sata)) ? 1 : 0; aoac->espi = 1; } -- cgit v1.2.3