diff options
author | Vivien Didelot <vivien.didelot@gmail.com> | 2019-08-31 23:18:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-01 22:16:38 +0300 |
commit | dc272f600eb3c3453c1289b095c6749d3241ae81 (patch) | |
tree | b43ab2dcb6f5ca0d5051433b7ed7308b0795fe7a /drivers/net/dsa/mv88e6xxx/chip.c | |
parent | 6600d8e5822d9b3f98c82db3e96df6895b1e87d8 (diff) | |
download | linux-dc272f600eb3c3453c1289b095c6749d3241ae81.tar.xz |
net: dsa: mv88e6xxx: pass lane to .serdes_power
Now the first step of all .serdes_power implementations is getting
the lane mapping. Since we have an operation for that, call it in
the wrapper and pass the lane down to the .serdes_power operation.
This also allows to avoid querying the SERDES lane twice in
mv88e6xxx_port_set_cmode.
At the same time provide mv88e6xxx_serdes_power_{up,down} helpers
and prefer up/down instead of on/off as in the documentation.
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 3962e7368ae5..3522b11d5566 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2057,13 +2057,15 @@ static int mv88e6xxx_setup_egress_floods(struct mv88e6xxx_chip *chip, int port) static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on) { + u8 lane; int err; - if (!chip->info->ops->serdes_power) + lane = mv88e6xxx_serdes_get_lane(chip, port); + if (!lane) return 0; if (on) { - err = chip->info->ops->serdes_power(chip, port, true); + err = mv88e6xxx_serdes_power_up(chip, port, lane); if (err) return err; @@ -2074,7 +2076,7 @@ static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port, chip->ports[port].serdes_irq) chip->info->ops->serdes_irq_free(chip, port); - err = chip->info->ops->serdes_power(chip, port, false); + err = mv88e6xxx_serdes_power_down(chip, port, lane); } return err; |