This patch series moves the lan9303 driver to use the phylink
api away from phylib.
Note a preparatory patch addresses whitespace issues to make the
dsa_switch_ops code consistent.
Note the .port_max_mtu api patch is now removed from this series. It
was unrelated and has little to no value if the api is never being
called for the cpu port.
Migrating to phylink means removing the .adjust_link api. The
functionality from the adjust_link is moved to the phylink_mac_link_up
api. The code being removed only affected the cpu port.
---
v3-> v4:
- Addressed whitespace issues as a separate patch.
- Removed port_max_mtu api patch as it is unrelated to phylink migration.
- Reworked the implementation to preserve the adjust_link functionality
by including it in the phylink_mac_link_up api.
v2-> v3:
Added back in disabling Turbo Mode on the CPU MII interface.
Removed the unnecessary clearing of the phyvsupported interfaces.
v1-> v2:
corrected the reported mtu size, removing ETH_HLEN and ETH_FCS_LEN
drivers/net/dsa/lan9303-core.c | 93 ++++++++++++--------
1 file changed, 56 insertions(+), 37 deletions(-)
Whitespace preparatory patch, making the dsa_switch_ops table consistent.
No code is added or removed.
Signed-off-by: Jerry Ray <[email protected]>
---
drivers/net/dsa/lan9303-core.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 80f07bd20593..d9f7b554a423 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -1280,16 +1280,16 @@ static int lan9303_port_mdb_del(struct dsa_switch *ds, int port,
}
static const struct dsa_switch_ops lan9303_switch_ops = {
- .get_tag_protocol = lan9303_get_tag_protocol,
- .setup = lan9303_setup,
- .get_strings = lan9303_get_strings,
- .phy_read = lan9303_phy_read,
- .phy_write = lan9303_phy_write,
- .adjust_link = lan9303_adjust_link,
- .get_ethtool_stats = lan9303_get_ethtool_stats,
- .get_sset_count = lan9303_get_sset_count,
- .port_enable = lan9303_port_enable,
- .port_disable = lan9303_port_disable,
+ .get_tag_protocol = lan9303_get_tag_protocol,
+ .setup = lan9303_setup,
+ .get_strings = lan9303_get_strings,
+ .phy_read = lan9303_phy_read,
+ .phy_write = lan9303_phy_write,
+ .adjust_link = lan9303_adjust_link,
+ .get_ethtool_stats = lan9303_get_ethtool_stats,
+ .get_sset_count = lan9303_get_sset_count,
+ .port_enable = lan9303_port_enable,
+ .port_disable = lan9303_port_disable,
.port_bridge_join = lan9303_port_bridge_join,
.port_bridge_leave = lan9303_port_bridge_leave,
.port_stp_state_set = lan9303_port_stp_state_set,
--
2.17.1
Please name the commit message something more specific than "Whitespace Only",
that is likely to not be confused with some other patch. A "Whitespace Only"
patch can take place anywhere in this file. Like "align dsa_switch_ops members".
On Wed, Dec 07, 2022 at 05:28:27PM -0600, Jerry Ray wrote:
> Whitespace preparatory patch, making the dsa_switch_ops table consistent.
> No code is added or removed.
>
> Signed-off-by: Jerry Ray <[email protected]>
> ---
> drivers/net/dsa/lan9303-core.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
> index 80f07bd20593..d9f7b554a423 100644
> --- a/drivers/net/dsa/lan9303-core.c
> +++ b/drivers/net/dsa/lan9303-core.c
> @@ -1280,16 +1280,16 @@ static int lan9303_port_mdb_del(struct dsa_switch *ds, int port,
> }
>
> static const struct dsa_switch_ops lan9303_switch_ops = {
> - .get_tag_protocol = lan9303_get_tag_protocol,
> - .setup = lan9303_setup,
> - .get_strings = lan9303_get_strings,
> - .phy_read = lan9303_phy_read,
> - .phy_write = lan9303_phy_write,
> - .adjust_link = lan9303_adjust_link,
> - .get_ethtool_stats = lan9303_get_ethtool_stats,
> - .get_sset_count = lan9303_get_sset_count,
> - .port_enable = lan9303_port_enable,
> - .port_disable = lan9303_port_disable,
> + .get_tag_protocol = lan9303_get_tag_protocol,
> + .setup = lan9303_setup,
> + .get_strings = lan9303_get_strings,
> + .phy_read = lan9303_phy_read,
> + .phy_write = lan9303_phy_write,
> + .adjust_link = lan9303_adjust_link,
> + .get_ethtool_stats = lan9303_get_ethtool_stats,
> + .get_sset_count = lan9303_get_sset_count,
> + .port_enable = lan9303_port_enable,
> + .port_disable = lan9303_port_disable,
Do you use a text editor which highlights tabs? The members above this
line are aligned with tabs, the ones below with spaces. Still not
exactly what I'd call "consistent".
> .port_bridge_join = lan9303_port_bridge_join,
> .port_bridge_leave = lan9303_port_bridge_leave,
> .port_stp_state_set = lan9303_port_stp_state_set,
> --
> 2.17.1
>
> Please name the commit message something more specific than "Whitespace Only",
> that is likely to not be confused with some other patch. A "Whitespace Only"
> patch can take place anywhere in this file. Like "align dsa_switch_ops members".
>
> Do you use a text editor which highlights tabs? The members above this
> line are aligned with tabs, the ones below with spaces. Still not
> exactly what I'd call "consistent".
>
Hi Vladimir,
Thank you for your comments. I will rename the patch to be more explicit and
will address the tabs-spaces issue you pointed out.
I'll look for a better Linux-based text editor this weekend. Do you have a
recommendation?
Regards,
Jerry.
On Fri, Dec 09, 2022 at 07:25:15PM +0000, [email protected] wrote:
> Hi Vladimir,
>
> Thank you for your comments. I will rename the patch to be more explicit and
> will address the tabs-spaces issue you pointed out.
>
> I'll look for a better Linux-based text editor this weekend. Do you have a
> recommendation?
Text editors are more of a personal choice, I'm in no position to recommend
one over another. There are quite a few which fulfill the requirements of
proper code highlighting, given the right configuration.