From 98a917443efa7429dd92b073e00876cfb274a058 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 21 May 2018 21:29:16 +0300 Subject: device: Replace ugly cases of dev_find_slot() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These few cases lacked a proper devfn parameter in the form of PCI_DEVFN(dev, fn). Change-Id: Iad0b214df12dee65360d07e887a960b0c73a3e4f Signed-off-by: Kyösti Mälkki Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/26481 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh --- src/southbridge/amd/rs780/gfx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/southbridge/amd/rs780') diff --git a/src/southbridge/amd/rs780/gfx.c b/src/southbridge/amd/rs780/gfx.c index b17aebb0cc..575a340894 100644 --- a/src/southbridge/amd/rs780/gfx.c +++ b/src/southbridge/amd/rs780/gfx.c @@ -319,9 +319,9 @@ static void internal_gfx_pci_dev_init(struct device *dev) u16 command; u32 value; u16 deviceid, vendorid; - struct device *nb_dev = dev_find_slot(0, 0); - struct device *k8_f2 = dev_find_slot(0, PCI_DEVFN(0x18, 2)); - struct device *k8_f0 = dev_find_slot(0, PCI_DEVFN(0x18, 0)); + struct device *nb_dev = pcidev_on_root(0x0, 0); + struct device *k8_f2 = pcidev_on_root(0x18, 2); + struct device *k8_f0 = pcidev_on_root(0x18, 0); static const u8 ht_freq_lookup [] = {2, 0, 4, 0, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 0, 28, 30, 32}; static const u8 ht_width_lookup [] = {8, 16, 0, 0, 2, 4, 0, 0}; static const u16 memclk_lookup_fam0F [] = {100, 0, 133, 0, 0, 166, 0, 200}; @@ -733,7 +733,7 @@ static void internal_gfx_pci_dev_init(struct device *dev) static void rs780_internal_gfx_disable(struct device *dev) { u32 l_dword; - struct device *nb_dev = dev_find_slot(0, 0); + struct device *nb_dev = pcidev_on_root(0x0, 0); /* Disable internal GFX and enable external GFX. */ l_dword = pci_read_config32(nb_dev, 0x8c); @@ -753,7 +753,7 @@ static void rs780_internal_gfx_enable(struct device *dev) { u32 l_dword; int i; - struct device *nb_dev = dev_find_slot(0, 0); + struct device *nb_dev = pcidev_on_root(0x0, 0); msr_t sysmem; #if !IS_ENABLED(CONFIG_GFXUMA) -- cgit v1.2.3