Message ID | E1tfhYq-003aTm-Nx@rmk-PC.armlinux.org.uk (mailing list archive) |
---|---|
State | Under Review |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | [net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces | expand |
On Wed, Feb 05, 2025 at 03:43:32PM +0000, Russell King (Oracle) wrote: > Populate the PCS supported_interfaces bitmap with the interfaces that > this PCS supports. This makes the manual checking in miic_validate() > redundant, so remove that. > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 05 Feb 2025 15:43:32 +0000 you wrote: > Populate the PCS supported_interfaces bitmap with the interfaces that > this PCS supports. This makes the manual checking in miic_validate() > redundant, so remove that. > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> > --- > drivers/net/pcs/pcs-rzn1-miic.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) Here is the summary with links: - [net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces https://git.kernel.org/netdev/net-next/c/508df2de7b3e You are awesome, thank you!
diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c index 61944574d087..11a96459a425 100644 --- a/drivers/net/pcs/pcs-rzn1-miic.c +++ b/drivers/net/pcs/pcs-rzn1-miic.c @@ -268,17 +268,6 @@ static void miic_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, (MIIC_CONVCTRL_CONV_SPEED | MIIC_CONVCTRL_FULLD), val); } -static int miic_validate(struct phylink_pcs *pcs, unsigned long *supported, - const struct phylink_link_state *state) -{ - if (phy_interface_mode_is_rgmii(state->interface) || - state->interface == PHY_INTERFACE_MODE_RMII || - state->interface == PHY_INTERFACE_MODE_MII) - return 1; - - return -EINVAL; -} - static int miic_pre_init(struct phylink_pcs *pcs) { struct miic_port *miic_port = phylink_pcs_to_miic_port(pcs); @@ -307,7 +296,6 @@ static int miic_pre_init(struct phylink_pcs *pcs) } static const struct phylink_pcs_ops miic_phylink_ops = { - .pcs_validate = miic_validate, .pcs_config = miic_config, .pcs_link_up = miic_link_up, .pcs_pre_init = miic_pre_init, @@ -363,6 +351,10 @@ struct phylink_pcs *miic_create(struct device *dev, struct device_node *np) miic_port->pcs.ops = &miic_phylink_ops; miic_port->pcs.neg_mode = true; + phy_interface_set_rgmii(miic_port->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_RMII, miic_port->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_MII, miic_port->pcs.supported_interfaces); + return &miic_port->pcs; } EXPORT_SYMBOL(miic_create);
Populate the PCS supported_interfaces bitmap with the interfaces that this PCS supports. This makes the manual checking in miic_validate() redundant, so remove that. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/pcs/pcs-rzn1-miic.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)