diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-12-20 22:47:03 +0100 |
---|---|---|
committer | Shelley Chen <shchen@google.com> | 2023-12-26 17:09:30 +0000 |
commit | 727ee667561909ecb05a2671bd7d885aa111cd60 (patch) | |
tree | e3b055cb162579545c54dba54b868f7453fc17a4 /src/soc/amd/stoneyridge/fch.c | |
parent | 1b60e5c5c92e96b11a87d2649a0045bb451d9de1 (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/fch.c')
-rw-r--r-- | src/soc/amd/stoneyridge/fch.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; } |