ar8xxx_id_chip is used to determine current ar8xxx_chip using switch
id and this isn't needed during mdiodev probing.
Move it out of ar8xxx_probe_switch so that we can skip it.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
struct switch_dev *swdev;
int ret;
- ret = ar8xxx_id_chip(priv);
- if (ret)
- return ret;
-
chip = priv->chip;
swdev = &priv->dev;
priv->mii_bus = phydev->mdio.bus;
priv->pdev = &phydev->mdio.dev;
+ ret = ar8xxx_id_chip(priv);
+ if (ret)
+ goto free_priv;
+
ret = ar8xxx_probe_switch(priv);
if (ret)
goto free_priv;