mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: peppe.cavallaro@st.com, alexandre.torgue@st.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Corentin Labbe <clabbe.montjoie@gmail.com>
Subject: [PATCH v3 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid
Date: Wed, 15 Feb 2017 10:46:42 +0100	[thread overview]
Message-ID: <20170215094645.591-6-clabbe.montjoie@gmail.com> (raw)
In-Reply-To: <20170215094645.591-1-clabbe.montjoie@gmail.com>

This patch mutualise a bit by running stmmac_hw_fix_mac_speed() after
the switch in case of valid speed.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f7664b9..bebe810 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -719,7 +719,6 @@ static void stmmac_adjust_link(struct net_device *dev)
 				if (priv->plat->has_gmac ||
 				    priv->plat->has_gmac4)
 					ctrl &= ~priv->hw->link.port;
-				stmmac_hw_fix_mac_speed(priv);
 				break;
 			case 100:
 			case 10:
@@ -734,7 +733,6 @@ static void stmmac_adjust_link(struct net_device *dev)
 				} else {
 					ctrl &= ~priv->hw->link.port;
 				}
-				stmmac_hw_fix_mac_speed(priv);
 				break;
 			default:
 				netif_warn(priv, link, priv->dev,
@@ -742,7 +740,8 @@ static void stmmac_adjust_link(struct net_device *dev)
 				phydev->speed = SPEED_UNKNOWN;
 				break;
 			}
-
+			if (phydev->speed != SPEED_UNKNOWN)
+				stmmac_hw_fix_mac_speed(priv);
 			priv->speed = phydev->speed;
 		}
 
-- 
2.10.2

  parent reply	other threads:[~2017-02-15  9:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  9:46 [PATCH v3 0/8] misc patchs Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 1/8] net: stmmac: remove useless parenthesis Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 2/8] net: stmmac: likely is useless in occasional function Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 3/8] net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 4/8] net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed Corentin Labbe
2017-02-15  9:46 ` Corentin Labbe [this message]
2017-02-15  9:46 ` [PATCH v3 6/8] net: stmmac: split the stmmac_adjust_link 10/100 case Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 7/8] net: stmmac: reduce indentation by adding a continue Corentin Labbe
2017-02-15  9:46 ` [PATCH v3 8/8] net: stmmac: invert the logic for dumping regs Corentin Labbe
2017-02-15 18:21 ` [PATCH v3 0/8] misc patchs David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170215094645.591-6-clabbe.montjoie@gmail.com \
    --to=clabbe.montjoie@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®