emulation/{i440fx,q35}: Don't use PCI driver to set root PCI dev ops

This devices is always present so hooking up the ops in devicetree makes
more sense.

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I369129e365ce8596cad25b97d12168bb08e3ed0e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76241
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/emulation/qemu-i440fx/devicetree.cb b/src/mainboard/emulation/qemu-i440fx/devicetree.cb
index cecba1c..3e4475f 100644
--- a/src/mainboard/emulation/qemu-i440fx/devicetree.cb
+++ b/src/mainboard/emulation/qemu-i440fx/devicetree.cb
@@ -1,7 +1,7 @@
 chip mainboard/emulation/qemu-i440fx
 	device cpu_cluster 0 on	end
 	device domain 0 on
-		device pci 0.0 on end		# northbridge (i440fx)
+		device pci 0.0 on ops nb_operations end		# northbridge (i440fx)
 		chip southbridge/intel/i82371eb # southbridge
 			device pci 01.0 on end	# ISA bridge
 			device pci 01.1 on end	# IDE
diff --git a/src/mainboard/emulation/qemu-i440fx/mainboard.c b/src/mainboard/emulation/qemu-i440fx/mainboard.c
index 50c5c02..7debf8c 100644
--- a/src/mainboard/emulation/qemu-i440fx/mainboard.c
+++ b/src/mainboard/emulation/qemu-i440fx/mainboard.c
@@ -41,15 +41,9 @@
 	}
 }
 
-static struct device_operations nb_operations = {
+struct device_operations nb_operations = {
 	.read_resources   = qemu_nb_read_resources,
 	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.init             = qemu_nb_init,
 };
-
-static const struct pci_driver nb_driver __pci_driver = {
-	.ops = &nb_operations,
-	.vendor = 0x8086,
-	.device = 0x1237,
-};
diff --git a/src/mainboard/emulation/qemu-q35/devicetree.cb b/src/mainboard/emulation/qemu-q35/devicetree.cb
index 6bd3d9d..063c5e9 100644
--- a/src/mainboard/emulation/qemu-q35/devicetree.cb
+++ b/src/mainboard/emulation/qemu-q35/devicetree.cb
@@ -1,7 +1,7 @@
 chip mainboard/emulation/qemu-q35
 	device cpu_cluster 0 on end
 	device domain 0 on
-		device pci 0.0 mandatory end		# northbridge (q35)
+		device pci 0.0 mandatory ops nb_operations end		# northbridge (q35)
 		chip southbridge/intel/i82801ix
 			# present unconditionally
 			device pci 1f.0 mandatory
diff --git a/src/mainboard/emulation/qemu-q35/mainboard.c b/src/mainboard/emulation/qemu-q35/mainboard.c
index 7d6707c..1ff4c04 100644
--- a/src/mainboard/emulation/qemu-q35/mainboard.c
+++ b/src/mainboard/emulation/qemu-q35/mainboard.c
@@ -63,15 +63,9 @@
 }
 
 
-static struct device_operations nb_operations = {
+struct device_operations nb_operations = {
 	.read_resources   = qemu_nb_read_resources,
 	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.init             = qemu_nb_init,
 };
-
-static const struct pci_driver nb_driver __pci_driver = {
-	.ops = &nb_operations,
-	.vendor = 0x8086,
-	.device = 0x29c0,
-};