Skip to content

Commit bf9a17b

Browse files
Russell King (Oracle)davem330
authored andcommitted
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: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9607eaa commit bf9a17b

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

drivers/net/dsa/sja1105/sja1105_mdio.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
400400
}
401401

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

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

413-
mdiodev = mdio_device_create(bus, port);
414-
if (IS_ERR(mdiodev)) {
415-
rc = PTR_ERR(mdiodev);
416-
goto out_pcs_free;
417-
}
418-
419-
xpcs = xpcs_create(mdiodev, priv->phy_mode[port]);
420-
mdio_device_put(mdiodev);
412+
xpcs = xpcs_create_mdiodev(bus, port, priv->phy_mode[port]);
421413
if (IS_ERR(xpcs)) {
422414
rc = PTR_ERR(xpcs);
423415
goto out_pcs_free;

0 commit comments

Comments
 (0)