summaryrefslogtreecommitdiff
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-12-01 18:58:03 -0800
committerJakub Kicinski <kuba@kernel.org>2021-12-01 18:58:03 -0800
commit4a8e4640ddd1e18cade9f15e40f2d8cd65f173cf (patch)
treecc245a61fb2ed6b91bdb6fbde6052b4b0cd09fc7 /net/dsa/slave.c
parent8057cbb8335cf6d419866737504473833e1d128a (diff)
parenta2279b08c7f4c97ad93916dae5c02eeac34b7f2c (diff)
Merge branch 'net-dsa-convert-two-drivers-to-phylink_generic_validate'
Russell King says: ==================== net: dsa: convert two drivers to phylink_generic_validate() Patches 1 to 3 update core DSA code to allow drivers to be converted, and patches 4 and 5 convert hellcreek and lantiq to use this (both of which received reviewed-by from their maintainers.) As the rest have yet to be reviewed by their maintainers, they are not included here. Patch 1 had a request to change the formatting of it; I have not done so as I believe a patch should do one change and one change only - reformatting it is a separate change that should be in its own patch. However, as patch 2 gets rid of the reason for reformatting it, it would be pointless, and pure noise to include such an intermediary patch. Instead, I have swapped the order of patches 2 and 3 from the RFC series. ==================== Link: https://lore.kernel.org/r/YaYiiU9nvmVugqnJ@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index ad61f6bc8886..33b54eadc641 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1851,14 +1851,9 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
struct dsa_port *dp = dsa_slave_to_port(slave_dev);
struct device_node *port_dn = dp->dn;
struct dsa_switch *ds = dp->ds;
- phy_interface_t mode;
u32 phy_flags = 0;
int ret;
- ret = of_get_phy_mode(port_dn, &mode);
- if (ret)
- mode = PHY_INTERFACE_MODE_NA;
-
dp->pl_config.dev = &slave_dev->dev;
dp->pl_config.type = PHYLINK_NETDEV;
@@ -1871,17 +1866,9 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
dp->pl_config.poll_fixed_state = true;
}
- if (ds->ops->phylink_get_interfaces)
- ds->ops->phylink_get_interfaces(ds, dp->index,
- dp->pl_config.supported_interfaces);
-
- dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn), mode,
- &dsa_port_phylink_mac_ops);
- if (IS_ERR(dp->pl)) {
- netdev_err(slave_dev,
- "error creating PHYLINK: %ld\n", PTR_ERR(dp->pl));
- return PTR_ERR(dp->pl);
- }
+ ret = dsa_port_phylink_create(dp);
+ if (ret)
+ return ret;
if (ds->ops->get_phy_flags)
phy_flags = ds->ops->get_phy_flags(ds, dp->index);