diff mbox series

[1/2] net: ethernet: mvneta: Do not error out in non serdes modes

Message ID 20200624070045.8878-1-s.hauer@pengutronix.de
State Accepted
Delegated to: David Miller
Headers show
Series [1/2] net: ethernet: mvneta: Do not error out in non serdes modes | expand

Commit Message

Sascha Hauer June 24, 2020, 7 a.m. UTC
In mvneta_config_interface() the RGMII modes are catched by the default
case which is an error return. The RGMII modes are valid modes for the
driver, so instead of returning an error add a break statement to return
successfully.

This avoids this warning for non comphy SoCs which use RGMII, like
SolidRun Clearfog:

WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Russell King (Oracle) June 24, 2020, 9:53 a.m. UTC | #1
On Wed, Jun 24, 2020 at 09:00:44AM +0200, Sascha Hauer wrote:
> In mvneta_config_interface() the RGMII modes are catched by the default
> case which is an error return. The RGMII modes are valid modes for the
> driver, so instead of returning an error add a break statement to return
> successfully.
> 
> This avoids this warning for non comphy SoCs which use RGMII, like
> SolidRun Clearfog:
> 
> WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Fixes: b4748553f53f ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy")
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>

Thanks.

> ---
>  drivers/net/ethernet/marvell/mvneta.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index af60001728481..c4552f868157c 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -3571,7 +3571,7 @@ static int mvneta_config_interface(struct mvneta_port *pp,
>  				    MVNETA_HSGMII_SERDES_PROTO);
>  			break;
>  		default:
> -			return -EINVAL;
> +			break;
>  		}
>  	}
>  
> -- 
> 2.27.0
> 
>
David Miller June 24, 2020, 9:48 p.m. UTC | #2
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Wed, 24 Jun 2020 09:00:44 +0200

> In mvneta_config_interface() the RGMII modes are catched by the default
> case which is an error return. The RGMII modes are valid modes for the
> driver, so instead of returning an error add a break statement to return
> successfully.
> 
> This avoids this warning for non comphy SoCs which use RGMII, like
> SolidRun Clearfog:
> 
> WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index af60001728481..c4552f868157c 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3571,7 +3571,7 @@  static int mvneta_config_interface(struct mvneta_port *pp,
 				    MVNETA_HSGMII_SERDES_PROTO);
 			break;
 		default:
-			return -EINVAL;
+			break;
 		}
 	}