Skip to content

Commit 3db0577

Browse files
committed
Merge branch 'sja1105-cleanups'
Russell King says: ==================== convert sja1105 xpcs creation and remove xpcs_create This series of three patches converts sja1105 to use the newly provided xpcs_create_mdiodev(), and as there become no users of xpcs_create(), removes this function from the global namespace to discourage future direct use. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents f91e32d + 4739b9f commit 3db0577

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

drivers/net/dsa/sja1105/sja1105_mdio.c

Lines changed: 1 addition & 10 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,13 +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]);
412+
xpcs = xpcs_create_mdiodev(bus, port, priv->phy_mode[port]);
420413
if (IS_ERR(xpcs)) {
421414
rc = PTR_ERR(xpcs);
422415
goto out_pcs_free;
@@ -434,7 +427,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
434427
if (!priv->xpcs[port])
435428
continue;
436429

437-
mdio_device_free(priv->xpcs[port]->mdiodev);
438430
xpcs_destroy(priv->xpcs[port]);
439431
priv->xpcs[port] = NULL;
440432
}
@@ -457,7 +449,6 @@ static void sja1105_mdiobus_pcs_unregister(struct sja1105_private *priv)
457449
if (!priv->xpcs[port])
458450
continue;
459451

460-
mdio_device_free(priv->xpcs[port]->mdiodev);
461452
xpcs_destroy(priv->xpcs[port]);
462453
priv->xpcs[port] = NULL;
463454
}

drivers/net/pcs/pcs-xpcs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,8 @@ static const struct phylink_pcs_ops xpcs_phylink_ops = {
12241224
.pcs_link_up = xpcs_link_up,
12251225
};
12261226

1227-
struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
1228-
phy_interface_t interface)
1227+
static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
1228+
phy_interface_t interface)
12291229
{
12301230
struct dw_xpcs *xpcs;
12311231
u32 xpcs_id;
@@ -1273,7 +1273,6 @@ struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
12731273

12741274
return ERR_PTR(ret);
12751275
}
1276-
EXPORT_SYMBOL_GPL(xpcs_create);
12771276

12781277
void xpcs_destroy(struct dw_xpcs *xpcs)
12791278
{

include/linux/pcs/pcs-xpcs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
3535
void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces);
3636
int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
3737
int enable);
38-
struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
39-
phy_interface_t interface);
4038
struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr,
4139
phy_interface_t interface);
4240
void xpcs_destroy(struct dw_xpcs *xpcs);

0 commit comments

Comments
 (0)