[PATCH net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces

Subsystems: ethernet phy library, networking drivers, renesas rz/n1 a5psw switch driver, the rest

STALE577d

3 messages, 3 authors, 2025-02-07 · open the first message on its own page

[PATCH net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces

From: Russell King (Oracle) <hidden>
Date: 2025-02-05 15:44:00

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) <redacted>
---
 drivers/net/pcs/pcs-rzn1-miic.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
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);
-- 
2.30.2

Re: [PATCH net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-02-05 17:24:36

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) <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

Re: [PATCH net-next] net: pcs: rzn1-miic: fill in PCS supported_interfaces

From: patchwork-bot+netdevbpf@kernel.org
Date: 2025-02-07 01:40:06

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski [off-list ref]:

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) <redacted>
---
 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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help