git: 13671022ebfb - stable/14 - linuxkpi: hdmi: Split the module declaration to a new file

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Tue, 04 Jun 2024 11:19:41 UTC
The branch stable/14 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=13671022ebfb31ad49480973801fb4742a773a20

commit 13671022ebfb31ad49480973801fb4742a773a20
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2024-04-24 07:59:20 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2024-06-04 11:06:40 +0000

    linuxkpi: hdmi: Split the module declaration to a new file
    
    In order to have a proper linuxkpi_video kmod, move the module declaration
    to a new file as linuxkpi_video will also include linux_hdmi.c
    
    Differential Revision:  https://reviews.freebsd.org/D44926
    Reviewed by:            bz, emaste, wulf
    Sponsored by:           Beckhoff Automation GmbH & Co. KG
    
    (cherry picked from commit 7f84bb34a1d191949ec519a01c0c574f5e827c88)
---
 sys/compat/linuxkpi/common/src/linux_hdmi.c        | 10 ----------
 sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c |  7 +++++++
 sys/modules/linuxkpi_hdmi/Makefile                 |  1 +
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_hdmi.c b/sys/compat/linuxkpi/common/src/linux_hdmi.c
index 172616306506..947be761dfa4 100644
--- a/sys/compat/linuxkpi/common/src/linux_hdmi.c
+++ b/sys/compat/linuxkpi/common/src/linux_hdmi.c
@@ -21,12 +21,6 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifdef __FreeBSD__
-#include <sys/cdefs.h>
-#include <sys/param.h>
-#include <sys/module.h>
-#endif
-
 #include <linux/bitops.h>
 #include <linux/bug.h>
 #include <linux/errno.h>
@@ -1915,7 +1909,3 @@ int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
 	return ret;
 }
 EXPORT_SYMBOL(hdmi_infoframe_unpack);
-
-
-MODULE_VERSION(linuxkpi_hdmi, 1);
-MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1);
diff --git a/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c
new file mode 100644
index 000000000000..b0d4c013a6f3
--- /dev/null
+++ b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c
@@ -0,0 +1,7 @@
+/* Public domain. */
+
+#include <sys/param.h>
+#include <sys/module.h>
+
+MODULE_VERSION(linuxkpi_hdmi, 1);
+MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1);
diff --git a/sys/modules/linuxkpi_hdmi/Makefile b/sys/modules/linuxkpi_hdmi/Makefile
index ef843c726dac..dc19c0afeebc 100644
--- a/sys/modules/linuxkpi_hdmi/Makefile
+++ b/sys/modules/linuxkpi_hdmi/Makefile
@@ -2,6 +2,7 @@
 
 KMOD=	linuxkpi_hdmi
 SRCS=	linux_hdmi.c \
+	linuxkpi_hdmikmod.c
 
 SRCS+=	${LINUXKPI_GENSRCS}