On Fri, Nov 27, 2026 at 3:04 PM Markus Elfring [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Markus Elfring <redacted>
Date: Fri, 27 Nov 2026 11:52:23 +0100
A clk_prepare_enable(priv->phy_clk) call was specified within an if branch
in the implementation of the function “bcm_enet_probe” while
a clk_disable_unprepare(priv->phy_clk) call was unconditionally performed
in the implementation of the function “bcm_enet_remove”.
Move this clk_disable_unprepare() call into a corresponding if branch.
Fixes: 7e697ce99ceb09538cdc1dfa9ebb3db60236b0a7 ("bcm63xx_enet: use managed functions for clock/ioremap")
Cc: <redacted>
Signed-off-by: Markus Elfring <redacted>
---
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index f6595fdc888d..cc9a5cd2a2a3 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1915,6 +1915,9 @@ static void bcm_enet_remove(struct platform_device *pdev)
enet_writel(priv, 0, ENET_MIISC_REG);
if (priv->has_phy) {
+ if (!priv->use_external_mii)
+ clk_disable_unprepare(priv->phy_clk);
+
mdiobus_unregister(priv->mii_bus);
mdiobus_free(priv->mii_bus);
} else {@@ -1927,7 +1930,6 @@ static void bcm_enet_remove(struct platform_device *pdev)
}
/* disable hw block clocks */
- clk_disable_unprepare(priv->phy_clk);
clk_disable_unprepare() is NULL-safe, so it's fine to call it
unconditionally. This change fixes nothing, just adds potential
breakage (disabling the phy clock before unregistering the mdio bus
feels risky).
clk_disable_unprepare(priv->mac_clk);
Best regards,
Jonas