Commit 3db05776 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents f91e32de 4739b9f3
...@@ -400,7 +400,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv) ...@@ -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,13 +409,7 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv) ...@@ -410,13 +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]);
if (IS_ERR(xpcs)) { if (IS_ERR(xpcs)) {
rc = PTR_ERR(xpcs); rc = PTR_ERR(xpcs);
goto out_pcs_free; goto out_pcs_free;
...@@ -434,7 +427,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv) ...@@ -434,7 +427,6 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
if (!priv->xpcs[port]) if (!priv->xpcs[port])
continue; continue;
mdio_device_free(priv->xpcs[port]->mdiodev);
xpcs_destroy(priv->xpcs[port]); xpcs_destroy(priv->xpcs[port]);
priv->xpcs[port] = NULL; priv->xpcs[port] = NULL;
} }
...@@ -457,7 +449,6 @@ static void sja1105_mdiobus_pcs_unregister(struct sja1105_private *priv) ...@@ -457,7 +449,6 @@ static void sja1105_mdiobus_pcs_unregister(struct sja1105_private *priv)
if (!priv->xpcs[port]) if (!priv->xpcs[port])
continue; continue;
mdio_device_free(priv->xpcs[port]->mdiodev);
xpcs_destroy(priv->xpcs[port]); xpcs_destroy(priv->xpcs[port]);
priv->xpcs[port] = NULL; priv->xpcs[port] = NULL;
} }
......
...@@ -1224,8 +1224,8 @@ static const struct phylink_pcs_ops xpcs_phylink_ops = { ...@@ -1224,8 +1224,8 @@ static const struct phylink_pcs_ops xpcs_phylink_ops = {
.pcs_link_up = xpcs_link_up, .pcs_link_up = xpcs_link_up,
}; };
struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev, static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
phy_interface_t interface) phy_interface_t interface)
{ {
struct dw_xpcs *xpcs; struct dw_xpcs *xpcs;
u32 xpcs_id; u32 xpcs_id;
...@@ -1273,7 +1273,6 @@ struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev, ...@@ -1273,7 +1273,6 @@ struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
EXPORT_SYMBOL_GPL(xpcs_create);
void xpcs_destroy(struct dw_xpcs *xpcs) void xpcs_destroy(struct dw_xpcs *xpcs)
{ {
......
...@@ -35,8 +35,6 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface, ...@@ -35,8 +35,6 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces); void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces);
int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
int enable); int enable);
struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
phy_interface_t interface);
struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr, struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr,
phy_interface_t interface); phy_interface_t interface);
void xpcs_destroy(struct dw_xpcs *xpcs); void xpcs_destroy(struct dw_xpcs *xpcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment