net: stmmac: use "mdio_bus_data" local variable
We have a local variable for priv->plat->mdio_bus_data, which we use later in the conditional if() block, but we evaluate the above within the conditional expression. Use mdio_bus_data instead. Since these will be the only two users of this local variable, move its assignment just before the if(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1qZAXJ-005pU1-1z@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1a37c1c198
commit
2b070cdd3a
@ -1199,7 +1199,7 @@ static int stmmac_init_phy(struct net_device *dev)
|
||||
|
||||
static int stmmac_phy_setup(struct stmmac_priv *priv)
|
||||
{
|
||||
struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
|
||||
struct stmmac_mdio_bus_data *mdio_bus_data;
|
||||
int max_speed = priv->plat->max_speed;
|
||||
int mode = priv->plat->phy_interface;
|
||||
struct fwnode_handle *fwnode;
|
||||
@ -1207,7 +1207,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
|
||||
|
||||
priv->phylink_config.dev = &priv->dev->dev;
|
||||
priv->phylink_config.type = PHYLINK_NETDEV;
|
||||
if (priv->plat->mdio_bus_data)
|
||||
|
||||
mdio_bus_data = priv->plat->mdio_bus_data;
|
||||
if (mdio_bus_data)
|
||||
priv->phylink_config.ovr_an_inband =
|
||||
mdio_bus_data->xpcs_an_inband;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user