]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: usb: lan78xx: refactor PHY init to separate detection and MAC configuration
authorOleksij Rempel <o.rempel@pengutronix.de>
Mon, 5 May 2025 08:43:37 +0000 (10:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 May 2025 11:57:05 +0000 (12:57 +0100)
commitd39f339d2603736ff90b0b32d9aea3b954307fd5
treec3fee0c2d85305afc5d95205fd60f60f9596b683
parent3da0ae52705d609f7d080a8158cd46db222b29de
net: usb: lan78xx: refactor PHY init to separate detection and MAC configuration

Split out PHY detection into lan78xx_get_phy() and MAC-side setup into
lan78xx_mac_prepare_for_phy(), making the main lan78xx_phy_init() cleaner
and easier to follow.

This improves separation of concerns and prepares the code for a future
transition to phylink. Fixed PHY registration and interface selection
are now handled in lan78xx_get_phy(), while MAC-side delay configuration
is done in lan78xx_mac_prepare_for_phy().

The fixed PHY fallback is preserved for setups like EVB-KSZ9897-1,
where LAN7801 connects directly to a KSZ switch without a standard PHY
or device tree support.

No functional changes intended.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/lan78xx.c