soc/cavium/cn81xx: Replace uses of dev_find_slot()

Change-Id: I9f176caff3b6423121676eb895f5f68a5b926de4
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/30517
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/soc/cavium/cn81xx/ecam0.c b/src/soc/cavium/cn81xx/ecam0.c
index cff2507..6747fa6a 100644
--- a/src/soc/cavium/cn81xx/ecam0.c
+++ b/src/soc/cavium/cn81xx/ecam0.c
@@ -273,7 +273,7 @@
 	u32 reg32;
 
 	printk(BIOS_INFO, "ECAM0: init\n");
-	const struct device *bridge = dev_find_slot(0, PCI_DEVFN(1, 0));
+	const struct device *bridge = pcidev_on_root(1, 0);
 	if (!bridge) {
 		printk(BIOS_INFO, "ECAM0: ERROR: PCI 00:01.0 not found.\n");
 		return;
@@ -287,7 +287,7 @@
 	/* Program secure ARI capability on bus 1 */
 	child_last = NULL;
 	for (i = 0; i <= PCI_DEVFN(0x1f, 7); i++) {
-		child = dev_find_slot(bridge->link_list->secondary, i);
+		child = pcidev_path_behind(bridge->link_list, i);
 		if (!child || !child->enabled)
 			continue;
 
@@ -306,7 +306,7 @@
 	/* Program insecure ARI capability on bus 1 */
 	child_last = NULL;
 	for (i = 0; i <= PCI_DEVFN(0x1f, 7); i++) {
-		child = dev_find_slot(bridge->link_list->secondary, i);
+		child = pcidev_path_behind(bridge->link_list, i);
 		if (!child)
 			continue;
 		config = child->chip_info;
@@ -327,7 +327,7 @@
 
 	/* Enable / disable devices on bus 0 */
 	for (i = 0; i <= 0x1f; i++) {
-		child = dev_find_slot(0, PCI_DEVFN(i, 0));
+		child = pcidev_on_root(i, 0);
 		config = child ? child->chip_info : NULL;
 		if (child && child->enabled && config && !config->secure)
 			enable_device(i);
@@ -337,7 +337,7 @@
 
 	/* Enable / disable devices and functions on bus 1 */
 	for (i = 0; i <= PCI_DEVFN(0x1f, 7); i++) {
-		child = dev_find_slot(bridge->link_list->secondary, i);
+		child = pcidev_path_behind(bridge->link_list, i);
 		config = child ? child->chip_info : NULL;
 		if (child && child->enabled &&
 		    ((config && !config->secure) || !config))
@@ -349,7 +349,7 @@
 	/* Apply IRQ on PCI devices */
 	/* UUA */
 	for (i = 0; i < 4; i++) {
-		child = dev_find_slot(bridge->link_list->secondary,
+		child = pcidev_path_behind(bridge->link_list,
 				      PCI_DEVFN(8, i));
 		if (!child)
 			continue;