net: freescale: ucc_geth: Return early when TBI PHY can't be found
PATCH v2 1/1 net: freescale: ucc_geth: Return early when TBI PHY can't be found
In ucc_geth's .mac_config(), we configure the TBI Serdes block represented by a struct phy_device that we get from firmware.
While porting to phylink, a check was missed to make sure we don't try to access the TBI PHY if we can't get it. Let's add it and return early in case of error
---
V2: Fix commit title, adjust a bit the commit log. No code change.
drivers/net/ethernet/freescale/ucc_geth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/ucc_geth.c +3 -1
@@ -1602,8 +1602,10 @@ static void ugeth_mac_config(struct phylink_config *config, unsigned int mode,pr_warn ("TBI mode requires that the device tree specify a tbi-handle\n" ); tbiphy =of_phy_find_device (ug_info->tbi_node); -if (!tbiphy) +if (!tbiphy) {pr_warn ("Could not get TBI device\n" ); +return ; + } value =phy_read (tbiphy,ENET_TBI_MII_CR ); value &= ~0x1000 ;/* Turn off autonegotiation */
Signature · 1 line
2.49.0
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 14 Jan 2026 09:02:46 +0100 you wrote:
In ucc_geth's .mac_config(), we configure the TBI Serdes block represented by a struct
phy_devicethat we get from firmware.While porting to phylink, a check was missed to make sure we don't try to access the TBI PHY if we can't get it. Let's add it and return early in case of error
[...]
Here is the summary with links:
- [net,v2] net: freescale: ucc_geth: Return early when TBI PHY can't be found
https://git.kernel.org/netdev/net/c/a74c7a58ca2c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html