Commit bf9a17b0 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller
Browse files

net: dsa: sja1105: use xpcs_create_mdiodev()



Use the new xpcs_create_mdiodev() creator, which simplifies the
creation and destruction of the mdio device associated with xpcs.

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9607eaad
Loading
Loading
Loading
Loading
+1 −9
Original line number Original line Diff line number Diff line
@@ -400,7 +400,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
	}
	}


	for (port = 0; port < ds->num_ports; port++) {
	for (port = 0; port < ds->num_ports; port++) {
		struct mdio_device *mdiodev;
		struct dw_xpcs *xpcs;
		struct dw_xpcs *xpcs;


		if (dsa_is_unused_port(ds, port))
		if (dsa_is_unused_port(ds, port))
@@ -410,14 +409,7 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
		    priv->phy_mode[port] != PHY_INTERFACE_MODE_2500BASEX)
		    priv->phy_mode[port] != PHY_INTERFACE_MODE_2500BASEX)
			continue;
			continue;


		mdiodev = mdio_device_create(bus, port);
		xpcs = xpcs_create_mdiodev(bus, port, priv->phy_mode[port]);
		if (IS_ERR(mdiodev)) {
			rc = PTR_ERR(mdiodev);
			goto out_pcs_free;
		}

		xpcs = xpcs_create(mdiodev, priv->phy_mode[port]);
		mdio_device_put(mdiodev);
		if (IS_ERR(xpcs)) {
		if (IS_ERR(xpcs)) {
			rc = PTR_ERR(xpcs);
			rc = PTR_ERR(xpcs);
			goto out_pcs_free;
			goto out_pcs_free;