Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2026 02:29:48 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7949253aeb32 - stable/15 - LinuxKPI: move MODULE_DEVICE_TABLE from pci.h to module.h
Message-ID:  <69a1019c.219b9.4043f5aa@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=7949253aeb324560dc0a0d5b574e305aad8ec79f

commit 7949253aeb324560dc0a0d5b574e305aad8ec79f
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-01-26 20:31:24 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-02-26 23:02:50 +0000

    LinuxKPI: move MODULE_DEVICE_TABLE from pci.h to module.h
    
    Move the MODULE_DEVICE_TABLE macro to module.h where it belongs
    in preparation for different bus (e.g., USB, SDIO) support.
    The various struct <bus>_device_id, if not elsewhere, should be
    defined in mod_devicetable.h.
    
    This is the next step after 2f5666c1727c.
    
    No functional changes.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    emaste, dumbbell
    Differential Revision: https://reviews.freebsd.org/D54900
    
    (cherry picked from commit 1f4fbcf342f41fecc8dff4e0d9a1f9bdb1cdf784)
---
 sys/compat/linuxkpi/common/include/linux/module.h | 18 ++++++++++++++++++
 sys/compat/linuxkpi/common/include/linux/pci.h    | 18 ------------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h
index 079dacf8df6c..fbe57cbbed82 100644
--- a/sys/compat/linuxkpi/common/include/linux/module.h
+++ b/sys/compat/linuxkpi/common/include/linux/module.h
@@ -53,6 +53,24 @@
 #define	MODULE_SUPPORTED_DEVICE(name)
 #define	MODULE_IMPORT_NS(_name)
 
+/* Linux has an empty element at the end of the ID table -> nitems() - 1. */
+#define	MODULE_DEVICE_TABLE(_bus, _table)				\
+									\
+static device_method_t _ ## _bus ## _ ## _table ## _methods[] = {	\
+	DEVMETHOD_END							\
+};									\
+									\
+static driver_t _ ## _bus ## _ ## _table ## _driver = {			\
+	"lkpi_" #_bus #_table,						\
+	_ ## _bus ## _ ## _table ## _methods,				\
+	0								\
+};									\
+									\
+DRIVER_MODULE(lkpi_ ## _table, _bus, _ ## _bus ## _ ## _table ## _driver,\
+	0, 0);								\
+									\
+MODULE_DEVICE_TABLE_BUS_ ## _bus(_bus, _table)
+
 /*
  * THIS_MODULE is used to differentiate modules on Linux. We currently
  * completely stub out any Linux struct module usage, but THIS_MODULE is still
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index cda1cf7dfb5e..9b7699a5ca59 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -76,24 +76,6 @@ struct pci_device_id {
 MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice",	\
     _bus, lkpi_ ## _table, _table, nitems(_table) - 1)
 
-/* Linux has an empty element at the end of the ID table -> nitems() - 1. */
-#define	MODULE_DEVICE_TABLE(_bus, _table)				\
-									\
-static device_method_t _ ## _bus ## _ ## _table ## _methods[] = {	\
-	DEVMETHOD_END							\
-};									\
-									\
-static driver_t _ ## _bus ## _ ## _table ## _driver = {			\
-	"lkpi_" #_bus #_table,						\
-	_ ## _bus ## _ ## _table ## _methods,				\
-	0								\
-};									\
-									\
-DRIVER_MODULE(lkpi_ ## _table, _bus, _ ## _bus ## _ ## _table ## _driver,\
-	0, 0);								\
-									\
-MODULE_DEVICE_TABLE_BUS_ ## _bus(_bus, _table)
-
 #define	PCI_ANY_ID			-1U
 
 #define PCI_DEVFN(slot, func)   ((((slot) & 0x1f) << 3) | ((func) & 0x07))


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a1019c.219b9.4043f5aa>