Re: [PATCH net-next 1/3] net: phylink: unwind the PHY binding when bringup fails late
From: Andrew Lunn
Date: Sat Aug 22 2026 - 13:31:04 EST
> + if (ret) {
> + mutex_lock(&pl->phydev_mutex);
> + mutex_lock(&phy->lock);
> + mutex_lock(&pl->state_mutex);
> + pl->phydev = NULL;
> + pl->phy_enable_tx_lpi = false;
> + pl->mac_tx_clk_stop = false;
> + mutex_unlock(&pl->state_mutex);
> + mutex_unlock(&phy->lock);
> + mutex_unlock(&pl->phydev_mutex);
> + }
This is the same as the inner part of phylink_disconnect_phy(). Maybe
pull it out into a helper?
Andrew