Merge branch 'net-dsa-microchip-use-phylink_mac_ops-for-ksz-driver'
authorJakub Kicinski <kuba@kernel.org>
Tue, 30 Apr 2024 02:02:38 +0000 (19:02 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Apr 2024 02:02:38 +0000 (19:02 -0700)
commit7253f97a994b87adad07735e8e281413bcc8c717
tree2ae1fd10260b650a300ed0caba71a0b549659049
parent89de2db19317fb89a6e9163f33c3a7b23ee75a18
parent968d068e547697e597c71e56fdc3d7c8a8dae23d
Merge branch 'net-dsa-microchip-use-phylink_mac_ops-for-ksz-driver'

Russell King says:

====================
net: dsa: microchip: use phylink_mac_ops for ksz driver

This four patch series switches the Microchip KSZ DSA driver to use
phylink_mac_ops support, and for this one we go a little further
beyond a simple conversion. This driver has four distinct cases:

lan937x
ksz9477
ksz8
ksz8830

Three of these cases are handled by shimming the existing DSA calls
through ksz_dev_ops, and the final case is handled through a
conditional in ksz_phylink_mac_config(). These can all be handled
with separate phylink_mac_ops.

To get there, we do a progressive conversion.

Patch 1 removes ksz_dev_ops' phylink_mac_config() method which is
not populated in any of the arrays - and is thus redundant.

Patch 2 switches the driver to use a common set of phylink_mac_ops
for all cases, doing the simple conversion to avoid the DSA shim.

Patch 3 pushes the phylink_mac_ops down to the first three classes
(lan937x, ksz9477, ksz8) adding an appropriate pointer to the
phylink_mac_ops to struct ksz_chip_data, and using that to
populate DSA's ds->phylink_mac_ops pointer. The difference between
each of these are the mac_link_up() method. mac_config() and
mac_link_down() remain common between each at this stage.

Patch 4 splits out ksz8830, which needs different mac_config()
handling, and thus means we have a difference in mac_config()
methods between the now four phylink_mac_ops structures.

Build tested only, with additional -Wunused-const-variable flag.
====================

Link: https://lore.kernel.org/r/ZivP/R1IwKEPb5T6@shell.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>