net: dsa: mv88e6xxx: combine port_set_speed and port_set_duplex
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 14 Mar 2020 10:15:53 +0000 (10:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2020 00:11:12 +0000 (17:11 -0700)
commitf365c6f7235aa9a40ed7bbca83ad086a43006b1c
tree44c6db22cf7a3028642faf4998ce637f357bdb3d
parent7e0e62431259b02a9c035f6cbaec2635add30921
net: dsa: mv88e6xxx: combine port_set_speed and port_set_duplex

Setting the speed independently of duplex makes little sense; the two
parameters result from negotiation or fixed setup, and may have inter-
dependencies. Moreover, they are always controlled via the same
register - having them split means we have to read-modify-write this
register twice.

Combine the two operations into a single port_set_speed_duplex()
operation. Not only is this more efficient, it reduces the size of the
code as well.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h
drivers/net/dsa/mv88e6xxx/port.c
drivers/net/dsa/mv88e6xxx/port.h