The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h>
@ 2026-07-06  9:29 Uwe Kleine-König (The Capable Hub)
  2026-07-06 14:17 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-06  9:29 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit; +Cc: Russell King, netdev, linux-kernel

<linux/mdio.h> itself doesn't use any of the device id structures. The
files #including <linux/mdio.h> use a variety of them:

	$ git grep -l '<linux/mdio.h>' | xargs grep --color  -E '\<(acpi_device_id|amba_id|ap_device_id|apr_device_id|auxiliary_device_id|bcma_device_id|ccw_device_id|cdx_device_id|coreboot_device_id|css_device_id|dfl_device_id|dmi_(device|system)_id|eisa_device_id|fsl_mc_device_id|hda_device_id|hid_device_id|hv_vmbus_device_id|i2c_device_id|i3c_device_id|ieee1394_device_id|input_device_id|ipack_device_id|isapnp_device_id|ishtp_device_id|mcb_device_id|mdio_device_id|mei_cl_device_id|mhi_device_id|mips_cdmm_device_id|of_device_id|parisc_device_id|pci_device_id|pci_epf_device_id|pcmcia_device_id|platform_device_id|pnp_(card_)?device_id|rio_device_id|rpmsg_device_id|sdio_device_id|sdw_device_id|serio_device_id|slim_device_id|spi_device_id|spmi_device_id|ssam_device_id|ssb_device_id|tb_service_id|tee_client_device_id|typec_device_id|ulpi_device_id|usb_device_id|vchiq_device_id|virtio_device_id|wmi_device_id|x86_(cpu|device)_id|zorro_device_id|cpu_feature)\>'
	...

but none of them relies on <linux/mdio.h>'s #include.

<linux/mod_devicetable.h> is a bad header mixing many different device
id structures and thus is an unfortunate dependency because if e.g.
struct wmi_device_id is modified all users of <linux/mdio.h> need to be
recompiled despite none of them using struct wmi_device_id.

So drop the unused header.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
Hello,

the check that <linux/mod_devicetable.h> wasn't needed by all the users
of <linux/mdio.h> was done on top of v7.2-rc2.

Best regards
Uwe

 include/linux/mdio.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index f4f9d9609448..300805e66592 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -8,7 +8,6 @@
 
 #include <uapi/linux/mdio.h>
 #include <linux/bitfield.h>
-#include <linux/mod_devicetable.h>
 
 struct gpio_desc;
 struct mii_bus;

base-commit: 8cdeaa50eae8dad34885515f62559ee83e7e8dda
-- 
2.55.0.11.g153666a7d9bb


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h>
  2026-07-06  9:29 [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h> Uwe Kleine-König (The Capable Hub)
@ 2026-07-06 14:17 ` Andrew Lunn
  2026-07-06 20:48   ` Uwe Kleine-König (The Capable Hub)
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2026-07-06 14:17 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Heiner Kallweit, Russell King, netdev, linux-kernel

On Mon, Jul 06, 2026 at 11:29:19AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> <linux/mdio.h> itself doesn't use any of the device id structures. The
> files #including <linux/mdio.h> use a variety of them:
> 
> 	$ git grep -l '<linux/mdio.h>' | xargs grep --color  -E '\<(acpi_device_id|amba_id|ap_device_id|apr_device_id|auxiliary_device_id|bcma_device_id|ccw_device_id|cdx_device_id|coreboot_device_id|css_device_id|dfl_device_id|dmi_(device|system)_id|eisa_device_id|fsl_mc_device_id|hda_device_id|hid_device_id|hv_vmbus_device_id|i2c_device_id|i3c_device_id|ieee1394_device_id|input_device_id|ipack_device_id|isapnp_device_id|ishtp_device_id|mcb_device_id|mdio_device_id|mei_cl_device_id|mhi_device_id|mips_cdmm_device_id|of_device_id|parisc_device_id|pci_device_id|pci_epf_device_id|pcmcia_device_id|platform_device_id|pnp_(card_)?device_id|rio_device_id|rpmsg_device_id|sdio_device_id|sdw_device_id|serio_device_id|slim_device_id|spi_device_id|spmi_device_id|ssam_device_id|ssb_device_id|tb_service_id|tee_client_device_id|typec_device_id|ulpi_device_id|usb_device_id|vchiq_device_id|virtio_device_id|wmi_device_id|x86_(cpu|device)_id|zorro_device_id|cpu_feature)\>'
> 	...
> 
> but none of them relies on <linux/mdio.h>'s #include.
> 
> <linux/mod_devicetable.h> is a bad header mixing many different device
> id structures and thus is an unfortunate dependency because if e.g.
> struct wmi_device_id is modified all users of <linux/mdio.h> need to be
> recompiled despite none of them using struct wmi_device_id.
> 
> So drop the unused header.

While i agree that there are lots of unneeded dependencies here, does
this change actually solve anything? Pretty much every PHY driver
needs mdio_device_id, which is part of mod_devicetable.h. So it must
be getting included somehow.

I assume the long term plan is to move all the structure definitions
out of mod_devicetable.h, so a driver can include just the ones it
needs? Is this patch somehow a step along that path? Why not move
mdio_device_id into mod_devicetable_mdio.h and include that? It seems
like the more obvious fix.

	Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h>
  2026-07-06 14:17 ` Andrew Lunn
@ 2026-07-06 20:48   ` Uwe Kleine-König (The Capable Hub)
  2026-07-06 21:28     ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-06 20:48 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Heiner Kallweit, Russell King, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2562 bytes --]

Hello Andrew,

On Mon, Jul 06, 2026 at 04:17:47PM +0200, Andrew Lunn wrote:
> On Mon, Jul 06, 2026 at 11:29:19AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > <linux/mdio.h> itself doesn't use any of the device id structures. The
> > files #including <linux/mdio.h> use a variety of them:
> > 
> > 	$ git grep -l '<linux/mdio.h>' | xargs grep --color  -E '\<(acpi_device_id|amba_id|ap_device_id|apr_device_id|auxiliary_device_id|bcma_device_id|ccw_device_id|cdx_device_id|coreboot_device_id|css_device_id|dfl_device_id|dmi_(device|system)_id|eisa_device_id|fsl_mc_device_id|hda_device_id|hid_device_id|hv_vmbus_device_id|i2c_device_id|i3c_device_id|ieee1394_device_id|input_device_id|ipack_device_id|isapnp_device_id|ishtp_device_id|mcb_device_id|mdio_device_id|mei_cl_device_id|mhi_device_id|mips_cdmm_device_id|of_device_id|parisc_device_id|pci_device_id|pci_epf_device_id|pcmcia_device_id|platform_device_id|pnp_(card_)?device_id|rio_device_id|rpmsg_device_id|sdio_device_id|sdw_device_id|serio_device_id|slim_device_id|spi_device_id|spmi_device_id|ssam_device_id|ssb_device_id|tb_service_id|tee_client_device_id|typec_device_id|ulpi_device_id|usb_device_id|vchiq_device_id|virtio_device_id|wmi_device_id|x86_(cpu|device)_id|zorro_device_id|cpu_feature)\>'
> > 	...
> > 
> > but none of them relies on <linux/mdio.h>'s #include.
> > 
> > <linux/mod_devicetable.h> is a bad header mixing many different device
> > id structures and thus is an unfortunate dependency because if e.g.
> > struct wmi_device_id is modified all users of <linux/mdio.h> need to be
> > recompiled despite none of them using struct wmi_device_id.
> > 
> > So drop the unused header.
> 
> While i agree that there are lots of unneeded dependencies here, does
> this change actually solve anything? Pretty much every PHY driver
> needs mdio_device_id, which is part of mod_devicetable.h. So it must
> be getting included somehow.
> 
> I assume the long term plan is to move all the structure definitions
> out of mod_devicetable.h, so a driver can include just the ones it
> needs?

Yes, however not long term, but I intend to get most of this done for
7.3-rc1.

> Is this patch somehow a step along that path? Why not move
> mdio_device_id into mod_devicetable_mdio.h and include that? It seems
> like the more obvious fix.

That's exactly my thought, and there is commit ad428f5811bd
("mod_devicetable.h: Split into per subsystem headers") that is part of
v7.2-rc2 and that does exactly that (apart from the filename).

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h>
  2026-07-06 20:48   ` Uwe Kleine-König (The Capable Hub)
@ 2026-07-06 21:28     ` Andrew Lunn
  2026-07-07  7:15       ` Uwe Kleine-König (The Capable Hub)
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2026-07-06 21:28 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Heiner Kallweit, Russell King, netdev, linux-kernel

> That's exactly my thought, and there is commit ad428f5811bd
> ("mod_devicetable.h: Split into per subsystem headers") that is part of
> v7.2-rc2 and that does exactly that (apart from the filename).

Ah, O.K. net-next tends to great dragged along the -rcX versions. So
you can probably submit the networking changes in a weeks time. Just
make sure they apply to

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git

	Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h>
  2026-07-06 21:28     ` Andrew Lunn
@ 2026-07-07  7:15       ` Uwe Kleine-König (The Capable Hub)
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-07  7:15 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Heiner Kallweit, Russell King, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

Hello Andrew,

On Mon, Jul 06, 2026 at 11:28:33PM +0200, Andrew Lunn wrote:
> > That's exactly my thought, and there is commit ad428f5811bd
> > ("mod_devicetable.h: Split into per subsystem headers") that is part of
> > v7.2-rc2 and that does exactly that (apart from the filename).
> 
> Ah, O.K. net-next tends to great dragged along the -rcX versions. So
> you can probably submit the networking changes in a weeks time. Just
> make sure they apply to
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git

Note that while I created the patch under discussion on top of -rc2, the
justification is also valid on -rc1 and the patch doesn't use the new
headers, so it can be applied to the above repo already now.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-07  7:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  9:29 [PATCH v1 net-next] net: phy: Drop #inclusion of <linux/mod_devicetable.h> from <linux/mdio.h> Uwe Kleine-König (The Capable Hub)
2026-07-06 14:17 ` Andrew Lunn
2026-07-06 20:48   ` Uwe Kleine-König (The Capable Hub)
2026-07-06 21:28     ` Andrew Lunn
2026-07-07  7:15       ` Uwe Kleine-König (The Capable Hub)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox