git: 5c4c96d3ee38 - main - virtio: Remove unused devclass arguments to DRIVER_MODULE.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 06 May 2022 23:25:06 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=5c4c96d3ee38b45c87bff326ec4b0daf828c5e2a

commit 5c4c96d3ee38b45c87bff326ec4b0daf828c5e2a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-05-06 22:46:57 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-06 22:46:57 +0000

    virtio: Remove unused devclass arguments to DRIVER_MODULE.
---
 sys/dev/virtio/balloon/virtio_balloon.c | 4 +---
 sys/dev/virtio/block/virtio_blk.c       | 4 +---
 sys/dev/virtio/console/virtio_console.c | 4 +---
 sys/dev/virtio/mmio/virtio_mmio_acpi.c  | 4 +---
 sys/dev/virtio/mmio/virtio_mmio_fdt.c   | 7 ++-----
 sys/dev/virtio/network/if_vtnet.c       | 5 +----
 sys/dev/virtio/pci/virtio_pci_legacy.c  | 5 +----
 sys/dev/virtio/pci/virtio_pci_modern.c  | 5 +----
 sys/dev/virtio/random/virtio_random.c   | 4 +---
 sys/dev/virtio/scsi/virtio_scsi.c       | 4 +---
 sys/dev/virtio/virtio.h                 | 6 +++---
 11 files changed, 14 insertions(+), 38 deletions(-)

diff --git a/sys/dev/virtio/balloon/virtio_balloon.c b/sys/dev/virtio/balloon/virtio_balloon.c
index 966a715f7989..d3b0011d2d6a 100644
--- a/sys/dev/virtio/balloon/virtio_balloon.c
+++ b/sys/dev/virtio/balloon/virtio_balloon.c
@@ -156,10 +156,8 @@ static driver_t vtballoon_driver = {
 	vtballoon_methods,
 	sizeof(struct vtballoon_softc)
 };
-static devclass_t vtballoon_devclass;
 
-VIRTIO_DRIVER_MODULE(virtio_balloon, vtballoon_driver,
-    vtballoon_devclass, 0, 0);
+VIRTIO_DRIVER_MODULE(virtio_balloon, vtballoon_driver, 0, 0);
 MODULE_VERSION(virtio_balloon, 1);
 MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1);
 
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
index e4a20bfc3031..e1b9e2004add 100644
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -268,10 +268,8 @@ static driver_t vtblk_driver = {
 	vtblk_methods,
 	sizeof(struct vtblk_softc)
 };
-static devclass_t vtblk_devclass;
 
-VIRTIO_DRIVER_MODULE(virtio_blk, vtblk_driver, vtblk_devclass,
-    vtblk_modevent, 0);
+VIRTIO_DRIVER_MODULE(virtio_blk, vtblk_driver, vtblk_modevent, NULL);
 MODULE_VERSION(virtio_blk, 1);
 MODULE_DEPEND(virtio_blk, virtio, 1, 1, 1);
 
diff --git a/sys/dev/virtio/console/virtio_console.c b/sys/dev/virtio/console/virtio_console.c
index 33192f0bf618..ee1cef25ff5e 100644
--- a/sys/dev/virtio/console/virtio_console.c
+++ b/sys/dev/virtio/console/virtio_console.c
@@ -261,10 +261,8 @@ static driver_t vtcon_driver = {
 	vtcon_methods,
 	sizeof(struct vtcon_softc)
 };
-static devclass_t vtcon_devclass;
 
-VIRTIO_DRIVER_MODULE(virtio_console, vtcon_driver, vtcon_devclass,
-    vtcon_modevent, 0);
+VIRTIO_DRIVER_MODULE(virtio_console, vtcon_driver, vtcon_modevent, NULL);
 MODULE_VERSION(virtio_console, 1);
 MODULE_DEPEND(virtio_console, virtio, 1, 1, 1);
 
diff --git a/sys/dev/virtio/mmio/virtio_mmio_acpi.c b/sys/dev/virtio/mmio/virtio_mmio_acpi.c
index 0cb34f5aa873..d93184db0644 100644
--- a/sys/dev/virtio/mmio/virtio_mmio_acpi.c
+++ b/sys/dev/virtio/mmio/virtio_mmio_acpi.c
@@ -65,9 +65,7 @@ static device_method_t vtmmio_acpi_methods[] = {
 DEFINE_CLASS_1(virtio_mmio, vtmmio_acpi_driver, vtmmio_acpi_methods,
     sizeof(struct vtmmio_softc), vtmmio_driver);
 
-static devclass_t vtmmio_acpi_devclass;
-
-DRIVER_MODULE(virtio_mmio, acpi, vtmmio_acpi_driver, vtmmio_acpi_devclass, 0,0);
+DRIVER_MODULE(virtio_mmio, acpi, vtmmio_acpi_driver, 0,0);
 MODULE_DEPEND(virtio_mmio, acpi, 1, 1, 1);
 
 static int
diff --git a/sys/dev/virtio/mmio/virtio_mmio_fdt.c b/sys/dev/virtio/mmio/virtio_mmio_fdt.c
index a188df707946..ca6126b1b233 100644
--- a/sys/dev/virtio/mmio/virtio_mmio_fdt.c
+++ b/sys/dev/virtio/mmio/virtio_mmio_fdt.c
@@ -79,11 +79,8 @@ static device_method_t vtmmio_fdt_methods[] = {
 DEFINE_CLASS_1(virtio_mmio, vtmmio_fdt_driver, vtmmio_fdt_methods,
     sizeof(struct vtmmio_softc), vtmmio_driver);
 
-static devclass_t vtmmio_fdt_devclass;
-
-DRIVER_MODULE(virtio_mmio, simplebus, vtmmio_fdt_driver, vtmmio_fdt_devclass,
-    0, 0);
-DRIVER_MODULE(virtio_mmio, ofwbus, vtmmio_fdt_driver, vtmmio_fdt_devclass, 0,0);
+DRIVER_MODULE(virtio_mmio, simplebus, vtmmio_fdt_driver, 0, 0);
+DRIVER_MODULE(virtio_mmio, ofwbus, vtmmio_fdt_driver, 0,0);
 MODULE_DEPEND(virtio_mmio, simplebus, 1, 1, 1);
 MODULE_DEPEND(virtio_mmio, virtio, 1, 1, 1);
 
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index d86dec6a141d..264b185ba030 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -361,10 +361,7 @@ static driver_t vtnet_driver = {
     .methods = vtnet_methods,
     .size = sizeof(struct vtnet_softc)
 };
-static devclass_t vtnet_devclass;
-
-VIRTIO_DRIVER_MODULE(vtnet, vtnet_driver, vtnet_devclass,
-    vtnet_modevent, 0);
+VIRTIO_DRIVER_MODULE(vtnet, vtnet_driver, vtnet_modevent, NULL);
 MODULE_VERSION(vtnet, 1);
 MODULE_DEPEND(vtnet, virtio, 1, 1, 1);
 #ifdef DEV_NETMAP
diff --git a/sys/dev/virtio/pci/virtio_pci_legacy.c b/sys/dev/virtio/pci/virtio_pci_legacy.c
index 16627ed00e9a..b597bff4d067 100644
--- a/sys/dev/virtio/pci/virtio_pci_legacy.c
+++ b/sys/dev/virtio/pci/virtio_pci_legacy.c
@@ -188,10 +188,7 @@ static driver_t vtpci_legacy_driver = {
 	.size = sizeof(struct vtpci_legacy_softc)
 };
 
-devclass_t vtpci_legacy_devclass;
-
-DRIVER_MODULE(virtio_pci_legacy, pci, vtpci_legacy_driver,
-    vtpci_legacy_devclass, 0, 0);
+DRIVER_MODULE(virtio_pci_legacy, pci, vtpci_legacy_driver, 0, 0);
 
 static int
 vtpci_legacy_probe(device_t dev)
diff --git a/sys/dev/virtio/pci/virtio_pci_modern.c b/sys/dev/virtio/pci/virtio_pci_modern.c
index ef5298467f77..9641d1dd5d78 100644
--- a/sys/dev/virtio/pci/virtio_pci_modern.c
+++ b/sys/dev/virtio/pci/virtio_pci_modern.c
@@ -242,10 +242,7 @@ static driver_t vtpci_modern_driver = {
 	.size = sizeof(struct vtpci_modern_softc)
 };
 
-devclass_t vtpci_modern_devclass;
-
-DRIVER_MODULE(virtio_pci_modern, pci, vtpci_modern_driver,
-    vtpci_modern_devclass, 0, 0);
+DRIVER_MODULE(virtio_pci_modern, pci, vtpci_modern_driver, 0, 0);
 
 static int
 vtpci_modern_probe(device_t dev)
diff --git a/sys/dev/virtio/random/virtio_random.c b/sys/dev/virtio/random/virtio_random.c
index a95dcadcddcd..b0f5c6aff4d2 100644
--- a/sys/dev/virtio/random/virtio_random.c
+++ b/sys/dev/virtio/random/virtio_random.c
@@ -101,10 +101,8 @@ static driver_t vtrnd_driver = {
 	vtrnd_methods,
 	sizeof(struct vtrnd_softc)
 };
-static devclass_t vtrnd_devclass;
 
-VIRTIO_DRIVER_MODULE(virtio_random, vtrnd_driver, vtrnd_devclass,
-    vtrnd_modevent, 0);
+VIRTIO_DRIVER_MODULE(virtio_random, vtrnd_driver, vtrnd_modevent, NULL);
 MODULE_VERSION(virtio_random, 1);
 MODULE_DEPEND(virtio_random, virtio, 1, 1, 1);
 MODULE_DEPEND(virtio_random, random_device, 1, 1, 1);
diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c
index d152e3273659..23e84e89aab8 100644
--- a/sys/dev/virtio/scsi/virtio_scsi.c
+++ b/sys/dev/virtio/scsi/virtio_scsi.c
@@ -237,10 +237,8 @@ static driver_t vtscsi_driver = {
 	vtscsi_methods,
 	sizeof(struct vtscsi_softc)
 };
-static devclass_t vtscsi_devclass;
 
-VIRTIO_DRIVER_MODULE(virtio_scsi, vtscsi_driver, vtscsi_devclass,
-    vtscsi_modevent, 0);
+VIRTIO_DRIVER_MODULE(virtio_scsi, vtscsi_driver, vtscsi_modevent, NULL);
 MODULE_VERSION(virtio_scsi, 1);
 MODULE_DEPEND(virtio_scsi, virtio, 1, 1, 1);
 MODULE_DEPEND(virtio_scsi, cam, 1, 1, 1);
diff --git a/sys/dev/virtio/virtio.h b/sys/dev/virtio/virtio.h
index a9ed8b75fbf6..e86ce4ec6b39 100644
--- a/sys/dev/virtio/virtio.h
+++ b/sys/dev/virtio/virtio.h
@@ -68,9 +68,9 @@ struct virtio_feature_desc {
 	const char	*vfd_str;
 };
 
-#define VIRTIO_DRIVER_MODULE(name, driver, devclass, evh, arg)		\
-	DRIVER_MODULE(name, virtio_mmio, driver, devclass, evh, arg);	\
-	DRIVER_MODULE(name, virtio_pci, driver, devclass, evh, arg)
+#define VIRTIO_DRIVER_MODULE(name, driver, evh, arg)			\
+	DRIVER_MODULE(name, virtio_mmio, driver, evh, arg);		\
+	DRIVER_MODULE(name, virtio_pci, driver, evh, arg)
 
 struct virtio_pnp_match {
 	uint32_t	 device_type;