virtio: pci: Allow exclusion of legacy driver
authorAndrew Scull <ascull@google.com>
Thu, 21 Apr 2022 16:10:59 +0000 (16:10 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 3 May 2022 19:50:45 +0000 (15:50 -0400)
Add a new config to control whether the driver for legacy virtio PCI
devices is included in the build. VIRTIO_PCI_LEGACY is included by
default when VIRTIO_PCI is selected, but it can also be independently
toggled.

Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/virtio/Kconfig
drivers/virtio/Makefile

index 863c3fb..586263e 100644 (file)
@@ -37,6 +37,15 @@ config VIRTIO_PCI
          This driver provides support for virtio based paravirtual device
          drivers over PCI.
 
+config VIRTIO_PCI_LEGACY
+       bool "PCI driver for legacy virtio devices"
+       depends on PCI
+       select VIRTIO
+       default VIRTIO_PCI
+       help
+         This driver provides support for legacy virtio based paravirtual
+         device drivers over PCI.
+
 config VIRTIO_SANDBOX
        bool "Sandbox driver for virtio devices"
        depends on SANDBOX
index dc88809..4c63a6c 100644 (file)
@@ -5,7 +5,8 @@
 
 obj-y += virtio-uclass.o virtio_ring.o
 obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
-obj-$(CONFIG_VIRTIO_PCI) += virtio_pci_legacy.o virtio_pci_modern.o
+obj-$(CONFIG_VIRTIO_PCI) += virtio_pci_modern.o
+obj-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
 obj-$(CONFIG_VIRTIO_SANDBOX) += virtio_sandbox.o
 obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
 obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o