diff mbox

[U-Boot] net: phy: ti: Fix dp83867 RGMII_TXID interface path

Message ID 1481280362-22834-1-git-send-email-phil.edworthy@renesas.com
State Accepted
Commit 8abdeadc5c48e79d0ff37cf2215654a7e6866704
Delegated to: Joe Hershberger
Headers show

Commit Message

Phil Edworthy Dec. 9, 2016, 10:46 a.m. UTC
There is code that is specifically for RGMII_TXID interface, but this
will never get used because the code checks that the RGMII interface
is RGMII_ID to RGMII_RXID; RGMII_TXID is after this.

To fix this and avoid similar problems in the future, use the
phy_interface_is_rgmii helper function.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
This has _not_ been tested in any way, shape or form! It was picked
up when converting PHY code to use the phy_interface_is_rgmii helper
function.
---
 drivers/net/phy/ti.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Joe Hershberger Dec. 9, 2016, 6:25 p.m. UTC | #1
Hi Phil,

On Fri, Dec 9, 2016 at 4:46 AM, Phil Edworthy <phil.edworthy@renesas.com> wrote:
> There is code that is specifically for RGMII_TXID interface, but this
> will never get used because the code checks that the RGMII interface
> is RGMII_ID to RGMII_RXID; RGMII_TXID is after this.
>
> To fix this and avoid similar problems in the future, use the
> phy_interface_is_rgmii helper function.
>
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger Feb. 9, 2017, 4:27 p.m. UTC | #2
Hi Phil,

https://patchwork.ozlabs.org/patch/704405/ was applied to u-boot-net.git.

Thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c
index c55dd97..5e2b2dd 100644
--- a/drivers/net/phy/ti.c
+++ b/drivers/net/phy/ti.c
@@ -246,8 +246,7 @@  static int dp83867_config(struct phy_device *phydev)
 		phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_BISCR, 0x0);
 	}
 
-	if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
-	    (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
+	if (phy_interface_is_rgmii(phydev)) {
 		val = phy_read_mmd_indirect(phydev, DP83867_RGMIICTL,
 					    DP83867_DEVADDR, phydev->addr);