Re: [PATCH] mod_devicetable.h: Split into per subsystem headers
From: Uwe Kleine-König (The Capable Hub)
Date: Wed Jun 24 2026 - 02:35:35 EST
Hello,
On Tue, Jun 23, 2026 at 06:13:29PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> On Tue, Jun 23, 2026 at 07:54:12AM -0700, Linus Torvalds wrote:
> > On Tue, 23 Jun 2026 at 07:47, Uwe Kleine-König (The Capable Hub)
> > <u.kleine-koenig@xxxxxxxxxxxx> wrote:
> > >
> > > So in the end I expect a handful of driver patches plus switching the
> > > the most important (or maybe all) <linux/$something.h>s from
> > > <linux/mod_devicetable.h> to <linux/mod_device_id/$something>.
> > >
> > > I guess that is ok then, too?
> >
> > Sure, that sounds fine. I was expecting lots of files to include the
> > mod_device_id/xyz.h files by hand, since that's what currently happens
> > with that mod_devicetable.h file:
> >
> > $ git grep linux/mod_devicetable.h | wc -l
> > 1621
>
> These are mostly .c files. Currently I'm concentrating on the header
> files only:
>
> $ find -name \*.h | xargs grep linux/mod_devicetable.h | wc -l
> 91
>
> For these the effort-impact ratio is much better. Agreed that for .c
> files your script approach sounds right. Up to now I wasn't aware that
> there are that many .c files including <linux/mod_devicetable.h>
> directly.
>
> Assuming I create such a script, what would be the approach to apply the
> resulting patch? Do you want to run and commit after -rc1? The
> alternative would be to submit a patch per subsystem.
Heads up: It's not as easy as anticipated. Two (similar) types of
difficulties I hit are:
- drivers/platform/x86/msi-ec.c doesn't include
<linux/mod_devicetable.h> but (e.g.) <linux/acpi.h>. The latter used
to provide a definition for dmi_device_id. So when replacing
<linux/mod_devicetable.h> in <linux/acpi.h> by
<linux/mod_device_id/acpi.h>, drivers/platform/x86/msi-ec.c fails to
compile due to missing dmi_device_id.
- <linux/of_platform.h> makes use of resource_size_t. That was defined
before via <linux/mod_devicetable.h> -> <linux/types.h>, but
<linux/mod_device_id/of.h> doesn't include <linux/types.h>. Just
adding that to be sure not to introduce build regessions is sad.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature