OSDN Git Service

net: dsa: mv88e6xxx: simplify .serdes_get_lane
authorVivien Didelot <vivien.didelot@gmail.com>
Sat, 31 Aug 2019 20:18:30 +0000 (16:18 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Sep 2019 19:16:37 +0000 (12:16 -0700)
commit5122d4ec9e8053a5944bf77db6bd6c89143531d7
treee9e122b9db18a1a5d1ad133b8806dcd61b4a39cf
parent4241ef52372ebee93f4ed67e08c9316ccb20bdd7
net: dsa: mv88e6xxx: simplify .serdes_get_lane

Because the mapping between a SERDES interface and its lane is static,
we don't need to stick with negative error codes actually and we can
simply return 0 if there is no lane, just like the IRQ mapping.

This way we can keep a simple and intuitive API using unsigned lane
numbers while simplifying the implementations with single return
statements. Last but not least, fix the reverse chrismas tree in
mv88e6390x_serdes_get_lane.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.h
drivers/net/dsa/mv88e6xxx/port.c
drivers/net/dsa/mv88e6xxx/serdes.c
drivers/net/dsa/mv88e6xxx/serdes.h