* [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues
@ 2026-09-21 14:18 Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Uwe Kleine-König (The Capable Hub),
Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins, Armin Wolf
Cc: WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild, Sudeep Holla
Hello,
this is a next step in the deprecation of <linux/mod_devicetable.h>.
scripts/mod/devicetable-offsets.c and scripts/mod/file2alias.c are the
only users of that header that use more than a few device-id structs. So
their number of lines actually grows when unfolding the needed includes
into them. Still it is a reduction in build dependencies.
I suggest to take this via kbuild during the merge window. Would be great to
cook in next for a while before.
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (3):
Move struct cpu_feature to <linux/cpufeature.h>
devicetable-offsets: Include the needed device-id headers instead of
the catch-all
file2alias: Include the needed device-id headers instead of the
catch-all
arch/loongarch/kvm/main.c | 2 +-
include/linux/cpufeature.h | 12 ++++++-
include/linux/mod_devicetable.h | 13 -------
scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
scripts/mod/file2alias.c | 56 +++++++++++++++++++++++++++++-
5 files changed, 123 insertions(+), 17 deletions(-)
base-commit: 93f51579e7df248780214094418f205253383cc5
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h>
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Uwe Kleine-König (The Capable Hub),
Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins, Armin Wolf
Cc: WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild, Sudeep Holla
struct cpu_feature used to be defined in <linux/mod_devicetable.h>. It's
much better located in <linux/cpufeature.h>. The only downside is that
modpost and devicetable-offsets.h need the definition and thus
<linux/cpufeature.h> must be included explicitly there.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
arch/loongarch/kvm/main.c | 2 +-
include/linux/cpufeature.h | 12 +++++++++++-
include/linux/mod_devicetable.h | 13 -------------
scripts/mod/devicetable-offsets.c | 1 +
scripts/mod/file2alias.c | 1 +
5 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/arch/loongarch/kvm/main.c b/arch/loongarch/kvm/main.c
index 236523d2449d..d082dae61971 100644
--- a/arch/loongarch/kvm/main.c
+++ b/arch/loongarch/kvm/main.c
@@ -5,7 +5,7 @@
#include <linux/err.h>
#include <linux/module.h>
-#include <linux/mod_devicetable.h>
+#include <linux/cpufeature.h>
#include <linux/kvm_host.h>
#include <asm/cacheflush.h>
#include <asm/cpufeature.h>
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h
index 6aff540ee9e5..93c1da38aaf6 100644
--- a/include/linux/cpufeature.h
+++ b/include/linux/cpufeature.h
@@ -6,10 +6,20 @@
#ifndef __LINUX_CPUFEATURE_H
#define __LINUX_CPUFEATURE_H
+#include <linux/types.h>
+
+/*
+ * Generic table type for matching CPU features.
+ * @feature: the bit number of the feature (0 - 65535)
+ */
+
+struct cpu_feature {
+ __u16 feature;
+};
+
#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
#include <linux/init.h>
-#include <linux/mod_devicetable.h>
#include <asm/cpufeature.h>
/*
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index a397213bedac..9ce2429b455f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -8,10 +8,6 @@
#ifndef LINUX_MOD_DEVICETABLE_H
#define LINUX_MOD_DEVICETABLE_H
-#ifdef __KERNEL__
-#include <linux/types.h>
-#endif
-
#include "device-id/acpi.h"
#include "device-id/amba.h"
#include "device-id/ap.h"
@@ -69,13 +65,4 @@
#include "device-id/x86_cpu.h"
#include "device-id/zorro.h"
-/*
- * Generic table type for matching CPU features.
- * @feature: the bit number of the feature (0 - 65535)
- */
-
-struct cpu_feature {
- __u16 feature;
-};
-
#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index b4178c42d08f..b57dbbef8777 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#define COMPILE_OFFSETS
+#include <linux/cpufeature.h>
#include <linux/kbuild.h>
#include <linux/mod_devicetable.h>
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 8d36c74dec2d..88bff3207277 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -121,6 +121,7 @@ typedef struct {
/* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since
* we handle those differences explicitly below */
+#include "../../include/linux/cpufeature.h"
#include "../../include/linux/mod_devicetable.h"
struct devtable {
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier,
Uwe Kleine-König (The Capable Hub),
Jorge Sanjuan Garcia, Jose Javier Rodriguez Barbarin,
Josh Poimboeuf
Cc: linux-kbuild, linux-kernel, Sudeep Holla
<linux/mod_devicetable.h> is planned to go away. Include just the needed
bits in scripts/mod/devicetable-offsets.c which reduces dependencies as
<linux/mod_devicetable.h> includes several headers not needed here.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
scripts/mod/devicetable-offsets.c | 56 ++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index b57dbbef8777..1f4bbd014a3d 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -2,7 +2,61 @@
#define COMPILE_OFFSETS
#include <linux/cpufeature.h>
#include <linux/kbuild.h>
-#include <linux/mod_devicetable.h>
+
+#include <linux/device-id/acpi.h>
+#include <linux/device-id/amba.h>
+#include <linux/device-id/ap.h>
+#include <linux/device-id/auxiliary.h>
+#include <linux/device-id/bcma.h>
+#include <linux/device-id/ccw.h>
+#include <linux/device-id/cdx.h>
+#include <linux/device-id/coreboot.h>
+#include <linux/device-id/css.h>
+#include <linux/device-id/dfl.h>
+#include <linux/device-id/dmi.h>
+#include <linux/device-id/eisa.h>
+#include <linux/device-id/fsl_mc.h>
+#include <linux/device-id/hda.h>
+#include <linux/device-id/hid.h>
+#include <linux/device-id/hv_vmbus.h>
+#include <linux/device-id/i2c.h>
+#include <linux/device-id/i3c.h>
+#include <linux/device-id/ieee1394.h>
+#include <linux/device-id/input.h>
+#include <linux/device-id/ipack.h>
+#include <linux/device-id/isapnp.h>
+#include <linux/device-id/ishtp.h>
+#include <linux/device-id/mcb.h>
+#include <linux/device-id/mdio.h>
+#include <linux/device-id/mei_cl.h>
+#include <linux/device-id/mhi.h>
+#include <linux/device-id/mips_cdmm.h>
+#include <linux/device-id/of.h>
+#include <linux/device-id/parisc.h>
+#include <linux/device-id/pci.h>
+#include <linux/device-id/pcmcia.h>
+#include <linux/device-id/platform.h>
+#include <linux/device-id/pnp.h>
+#include <linux/device-id/rio.h>
+#include <linux/device-id/rpmsg.h>
+#include <linux/device-id/sdio.h>
+#include <linux/device-id/sdw.h>
+#include <linux/device-id/serio.h>
+#include <linux/device-id/slim.h>
+#include <linux/device-id/spi.h>
+#include <linux/device-id/ssam.h>
+#include <linux/device-id/ssb.h>
+#include <linux/device-id/tb.h>
+#include <linux/device-id/tee_client.h>
+#include <linux/device-id/typec.h>
+#include <linux/device-id/ulpi.h>
+#include <linux/device-id/usb.h>
+#include <linux/device-id/vchiq.h>
+#include <linux/device-id/vio.h>
+#include <linux/device-id/virtio.h>
+#include <linux/device-id/wmi.h>
+#include <linux/device-id/x86_cpu.h>
+#include <linux/device-id/zorro.h>
#define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
#define DEVID_FIELD(devid, field) \
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 3/3] file2alias: Include the needed device-id headers instead of the catch-all
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Alexey Gladkov,
Uwe Kleine-König (The Capable Hub),
Ilpo Järvinen, Armin Wolf, Hugh Dickins,
Jose Javier Rodriguez Barbarin, Hasan Basbunar
Cc: linux-kbuild, linux-kernel, Sudeep Holla
<linux/mod_devicetable.h> is planned to go away. Include just the needed
bits in scripts/mod/devicetable-offsets.c which reduces dependencies as
<linux/mod_devicetable.h> includes several headers not needed here.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
scripts/mod/file2alias.c | 55 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 88bff3207277..7d76233a8d5d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -122,7 +122,60 @@ typedef struct {
* even potentially has different endianness and word sizes, since
* we handle those differences explicitly below */
#include "../../include/linux/cpufeature.h"
-#include "../../include/linux/mod_devicetable.h"
+#include "../../include/linux/device-id/acpi.h"
+#include "../../include/linux/device-id/amba.h"
+#include "../../include/linux/device-id/ap.h"
+#include "../../include/linux/device-id/auxiliary.h"
+#include "../../include/linux/device-id/bcma.h"
+#include "../../include/linux/device-id/ccw.h"
+#include "../../include/linux/device-id/cdx.h"
+#include "../../include/linux/device-id/coreboot.h"
+#include "../../include/linux/device-id/css.h"
+#include "../../include/linux/device-id/dfl.h"
+#include "../../include/linux/device-id/dmi.h"
+#include "../../include/linux/device-id/eisa.h"
+#include "../../include/linux/device-id/fsl_mc.h"
+#include "../../include/linux/device-id/hda.h"
+#include "../../include/linux/device-id/hid.h"
+#include "../../include/linux/device-id/hv_vmbus.h"
+#include "../../include/linux/device-id/i2c.h"
+#include "../../include/linux/device-id/i3c.h"
+#include "../../include/linux/device-id/ieee1394.h"
+#include "../../include/linux/device-id/input.h"
+#include "../../include/linux/device-id/ipack.h"
+#include "../../include/linux/device-id/isapnp.h"
+#include "../../include/linux/device-id/ishtp.h"
+#include "../../include/linux/device-id/mcb.h"
+#include "../../include/linux/device-id/mdio.h"
+#include "../../include/linux/device-id/mei_cl.h"
+#include "../../include/linux/device-id/mhi.h"
+#include "../../include/linux/device-id/mips_cdmm.h"
+#include "../../include/linux/device-id/of.h"
+#include "../../include/linux/device-id/parisc.h"
+#include "../../include/linux/device-id/pci.h"
+#include "../../include/linux/device-id/pcmcia.h"
+#include "../../include/linux/device-id/platform.h"
+#include "../../include/linux/device-id/pnp.h"
+#include "../../include/linux/device-id/rio.h"
+#include "../../include/linux/device-id/rpmsg.h"
+#include "../../include/linux/device-id/sdio.h"
+#include "../../include/linux/device-id/sdw.h"
+#include "../../include/linux/device-id/serio.h"
+#include "../../include/linux/device-id/slim.h"
+#include "../../include/linux/device-id/spi.h"
+#include "../../include/linux/device-id/ssam.h"
+#include "../../include/linux/device-id/ssb.h"
+#include "../../include/linux/device-id/tb.h"
+#include "../../include/linux/device-id/tee_client.h"
+#include "../../include/linux/device-id/typec.h"
+#include "../../include/linux/device-id/ulpi.h"
+#include "../../include/linux/device-id/usb.h"
+#include "../../include/linux/device-id/vchiq.h"
+#include "../../include/linux/device-id/vio.h"
+#include "../../include/linux/device-id/virtio.h"
+#include "../../include/linux/device-id/wmi.h"
+#include "../../include/linux/device-id/x86_cpu.h"
+#include "../../include/linux/device-id/zorro.h"
struct devtable {
const char *device_id;
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-09-21 14:18 ` [PATCH v1 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
@ 2026-09-22 19:43 ` Armin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Armin Wolf @ 2026-09-22 19:43 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub),
Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins
Cc: WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild, Sudeep Holla
Am 21.09.26 um 16:18 schrieb Uwe Kleine-König (The Capable Hub):
> Hello,
>
> this is a next step in the deprecation of <linux/mod_devicetable.h>.
> scripts/mod/devicetable-offsets.c and scripts/mod/file2alias.c are the
> only users of that header that use more than a few device-id structs. So
> their number of lines actually grows when unfolding the needed includes
> into them. Still it is a reduction in build dependencies.
>
> I suggest to take this via kbuild during the merge window. Would be great to
> cook in next for a while before.
>
> Best regards
> Uwe
Acked-by: Armin Wolf <W_Armin@gmx.de>
>
> Uwe Kleine-König (The Capable Hub) (3):
> Move struct cpu_feature to <linux/cpufeature.h>
> devicetable-offsets: Include the needed device-id headers instead of
> the catch-all
> file2alias: Include the needed device-id headers instead of the
> catch-all
>
> arch/loongarch/kvm/main.c | 2 +-
> include/linux/cpufeature.h | 12 ++++++-
> include/linux/mod_devicetable.h | 13 -------
> scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
> scripts/mod/file2alias.c | 56 +++++++++++++++++++++++++++++-
> 5 files changed, 123 insertions(+), 17 deletions(-)
>
>
> base-commit: 93f51579e7df248780214094418f205253383cc5
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-22 19:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®