Skip to content

Commit 3be0d95

Browse files
robimarkoPaolo Abeni
authored andcommitted
net: phy: qca807x: move interface mode check to .config_init_once
Currently, we are checking whether the PHY package mode matches the individual PHY interface modes at PHY package probe time, but at that time we only know the PHY package mode and not the individual PHY interface modes as of_get_phy_mode() that populates it will only get called once the netdev to which PHY-s are attached to is being probed and thus this check will always fail and return -EINVAL. So, lets move this check to .config_init_once as at that point individual PHY interface modes should be populated. Fixes: d1cb613 ("net: phy: qcom: add support for QCA807x PHY Family") Signed-off-by: Robert Marko <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent d1d7712 commit 3be0d95

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/phy/qcom/qca807x.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ static int qca807x_phy_package_config_init_once(struct phy_device *phydev)
562562
struct qca807x_shared_priv *priv = shared->priv;
563563
int val, ret;
564564

565+
/* Make sure PHY follow PHY package mode if enforced */
566+
if (priv->package_mode != PHY_INTERFACE_MODE_NA &&
567+
phydev->interface != priv->package_mode)
568+
return -EINVAL;
569+
565570
phy_lock_mdio_bus(phydev);
566571

567572
/* Set correct PHY package mode */
@@ -718,11 +723,6 @@ static int qca807x_probe(struct phy_device *phydev)
718723
shared = phydev->shared;
719724
shared_priv = shared->priv;
720725

721-
/* Make sure PHY follow PHY package mode if enforced */
722-
if (shared_priv->package_mode != PHY_INTERFACE_MODE_NA &&
723-
phydev->interface != shared_priv->package_mode)
724-
return -EINVAL;
725-
726726
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
727727
if (!priv)
728728
return -ENOMEM;

0 commit comments

Comments
 (0)