git: 81ad4dba9475 - main - audio/oss: Remove devclass from DRIVER_MODULE on recent main.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 22 Aug 2022 18:15:31 UTC
The branch main has been updated by jhb (doc, src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=81ad4dba9475afeab3f602d2e27ccdb7b215364e

commit 81ad4dba9475afeab3f602d2e27ccdb7b215364e
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-08-22 18:15:07 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-08-22 18:15:07 +0000

    audio/oss: Remove devclass from DRIVER_MODULE on recent main.
    
    Differential Revision:  https://reviews.freebsd.org/D35957
---
 .../oss/files/patch-setup_FreeBSD_oss_build_bsdpci.inc | 13 ++++++++++---
 audio/oss/files/patch-setup_gen__driver__freebsd.inc   | 18 ++++++++++++++++++
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/audio/oss/files/patch-setup_FreeBSD_oss_build_bsdpci.inc b/audio/oss/files/patch-setup_FreeBSD_oss_build_bsdpci.inc
index 2abd09b8edcf..f608e82f8d96 100644
--- a/audio/oss/files/patch-setup_FreeBSD_oss_build_bsdpci.inc
+++ b/audio/oss/files/patch-setup_FreeBSD_oss_build_bsdpci.inc
@@ -1,6 +1,6 @@
---- setup/FreeBSD/oss/build/bsdpci.inc.orig	2014-02-14 22:59:55.000000000 +0000
-+++ setup/FreeBSD/oss/build/bsdpci.inc	2021-12-18 15:09:33.546812000 +0000
-@@ -92,8 +92,6 @@
+--- setup/FreeBSD/oss/build/bsdpci.inc.orig	2014-02-14 22:59:55 UTC
++++ setup/FreeBSD/oss/build/bsdpci.inc
+@@ -92,8 +92,6 @@ osspci_detach (device_t dev)
        osdev = device_list[i];
        if (osdev->dip == dev)
  	{
@@ -9,3 +9,10 @@
  	  if (!DRIVER_DETACH (osdev))
  	    {
  	      printf (DRIVER_NICK ": Unloading busy device\n");
+@@ -150,4 +148,6 @@ static device_method_t osspci_methods[] = {
+   {0, 0}
+ };
+ 
++#if __FreeBSD_version < 1400058
+ static devclass_t osspci_devclass;
++#endif
diff --git a/audio/oss/files/patch-setup_gen__driver__freebsd.inc b/audio/oss/files/patch-setup_gen__driver__freebsd.inc
new file mode 100644
index 000000000000..4f36c36b4045
--- /dev/null
+++ b/audio/oss/files/patch-setup_gen__driver__freebsd.inc
@@ -0,0 +1,18 @@
+--- setup/gen_driver_freebsd.inc.orig	2022-07-26 19:01:18 UTC
++++ setup/gen_driver_freebsd.inc
+@@ -233,9 +233,15 @@ generate_driver (char *name, conf_t * conf, char *cfg_
+       fprintf (src,
+ 	       "DEFINE_CLASS_0(%s, osspci_driver, osspci_methods, sizeof(struct _oss_device_t));\n",
+ 	       name);
++      fprintf (src, "#if __FreeBSD_version >= 1400058\n");
+       fprintf (src,
++	       "DRIVER_MODULE(%s, pci, osspci_driver, 0, 0);\n",
++	       name);
++      fprintf (src, "#else\n");
++      fprintf (src,
+ 	       "DRIVER_MODULE(%s, pci, osspci_driver, osspci_devclass, 0, 0);\n",
+ 	       name);
++      fprintf (src, "#endif\n");
+     }
+ 
+   for (i = 0; i < nopts; i++)