aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/qca8k.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-10-21 16:51:15 -0400
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-10-22 12:37:06 -0700
commit68bb8ea8ad0d497c28ed47423246b1ab20f26976 (patch)
tree8e7c4ca7da4bf3171ca335d0c85d752d6f3d66b9 /drivers/net/dsa/qca8k.c
parentMerge branch 'r8169-remove-fiddling-with-the-pcie-max-read-request-size' (diff)
downloadlinux-dev-68bb8ea8ad0d497c28ed47423246b1ab20f26976.tar.xz
linux-dev-68bb8ea8ad0d497c28ed47423246b1ab20f26976.zip
net: dsa: use dsa_to_port helper everywhere
Do not let the drivers access the ds->ports static array directly while there is a dsa_to_port helper for this purpose. At the same time, un-const this helper since the SJA1105 driver assigns the priv member of the returned dsa_port structure. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'drivers/net/dsa/qca8k.c')
-rw-r--r--drivers/net/dsa/qca8k.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index b00274caae4f..71e44c8763b8 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -661,7 +661,7 @@ qca8k_setup(struct dsa_switch *ds)
return ret;
/* Initialize CPU port pad mode (xMII type, delays...) */
- phy_mode = of_get_phy_mode(ds->ports[QCA8K_CPU_PORT].dn);
+ phy_mode = of_get_phy_mode(dsa_to_port(ds, QCA8K_CPU_PORT)->dn);
if (phy_mode < 0) {
pr_err("Can't find phy-mode for master device\n");
return phy_mode;