OSDN Git Service

net: dsa: ksz: added the generic port_stp_state_set function
authorArun Ramadoss <arun.ramadoss@microchip.com>
Sun, 24 Apr 2022 11:28:31 +0000 (16:58 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 26 Apr 2022 08:19:34 +0000 (10:19 +0200)
commitde6dd626d7082eda383ec77a5e06093c82122d10
tree1840f091fe15d9c7e588b99c0e7714494d316fcb
parentfb0a43f5bd454dfae94aeb293b32669c6ef83b37
net: dsa: ksz: added the generic port_stp_state_set function

The ksz8795 and ksz9477 uses the same algorithm for the
port_stp_state_set function except the register address is different. So
moved the algorithm to the ksz_common.c and used the dev_ops for
register read and write. This function can also used for the lan937x
part. Hence making it generic for all the parts.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220424112831.11504-1-arun.ramadoss@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/ksz8795.c
drivers/net/dsa/microchip/ksz8795_reg.h
drivers/net/dsa/microchip/ksz9477.c
drivers/net/dsa/microchip/ksz9477_reg.h
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h