summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaruch Siach <baruch.siach@siklu.com>2022-02-28 14:10:02 +0200
committerJakub Kicinski <kuba@kernel.org>2022-03-02 22:33:37 -0800
commit13b0bd2e62e7b16f273eb681174c842567015a39 (patch)
tree2cecbd7f19518c81e810d3318f247612942370fd
parentcb1d8fba91f2ecf828000707cc56a376498078a4 (diff)
net: dsa: mv88e6xxx: don't error out cmode set on missing lane
When the given cmode has no serdes, mv88e6xxx_serdes_get_lane() returns -NODEV. Earlier in the same function the code skips serdes handing in this case. Do the same after cmode set. Signed-off-by: Baruch Siach <baruch.siach@siklu.com> Link: https://lore.kernel.org/r/cd95cf3422ae8daf297a01fa9ec3931b203cdf45.1646050203.git.baruch@tkos.co.il Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/dsa/mv88e6xxx/port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index d08e3ec2b042..a58997f1fd69 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -610,6 +610,8 @@ static int mv88e6xxx_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
chip->ports[port].cmode = cmode;
lane = mv88e6xxx_serdes_get_lane(chip, port);
+ if (lane == -ENODEV)
+ return 0;
if (lane < 0)
return lane;