]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: ftgmac100: Always register the MDIO bus when it exists
authorAndrew Lunn <andrew@lunn.ch>
Fri, 6 Feb 2026 03:17:49 +0000 (11:17 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Feb 2026 12:40:50 +0000 (13:40 +0100)
commitefeb214411730dbbd7271bd0ad71823dec525289
tree2bbf867ca1c73ce73740b2ab38055233506d2b6a
parent7535d70ba0e73ae66df2636cc49bc6396f23520a
net: ftgmac100: Always register the MDIO bus when it exists

Both the Aspeed 2400 and 2500 and the original faraday version of the
MAC have MDIO bus controllers as part of the MAC. Since it exists,
always registering it makes the code simpler, and causes no harm. If
there is no mdio node in device tree, of_mdiobus_register() will fall
back to mdiobus_register(), making it safe.

AST2600 uses an external MDIO controller and does not have an embedded
MDIO bus in the MAC. For such configurations, the legacy MII probe path
must not be entered without a registered mii_bus.

Add an explicit check to fail gracefully when no MDIO bus is present,
preventing a NULL pointer dereference while keeping the intended
behavior for platforms without embedded MDIO.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
Link: https://patch.msgid.link/20260206-ftgmac-cleanup-v5-9-ad28a9067ea7@aspeedtech.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/faraday/ftgmac100.c