From patchwork Mon Dec 12 15:27:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 705058 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3tcmtK4Qt0z9t6g for ; Tue, 13 Dec 2016 02:27:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7621AA7593; Mon, 12 Dec 2016 16:27:35 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R0i_KcZLz30O; Mon, 12 Dec 2016 16:27:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD6554B811; Mon, 12 Dec 2016 16:27:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE1764B811 for ; Mon, 12 Dec 2016 16:27:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fmxju4wlgdw1 for ; Mon, 12 Dec 2016 16:27:30 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by theia.denx.de (Postfix) with ESMTP id 3A92F4B6B3 for ; Mon, 12 Dec 2016 16:27:26 +0100 (CET) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 13 Dec 2016 00:27:23 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 5F34965ADA; Tue, 13 Dec 2016 00:27:23 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 53D5228070; Tue, 13 Dec 2016 00:27:23 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 4C51B2806F; Tue, 13 Dec 2016 00:27:23 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id AAY30111; Tue, 13 Dec 2016 00:27:23 +0900 X-IronPort-AV: E=Sophos;i="5.33,336,1477926000"; d="scan'208";a="227750597" Received: from unknown (HELO localhost.localdomain) ([172.29.43.47]) by relmlii1.idc.renesas.com with ESMTP; 13 Dec 2016 00:27:21 +0900 From: Phil Edworthy To: Joe Hershberger Date: Mon, 12 Dec 2016 15:27:12 +0000 Message-Id: <1481556432-25729-1-git-send-email-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.7.4 Cc: u-boot@lists.denx.de, Stephen Warren , Michal Simek Subject: [U-Boot] [PATCH] net: phy: vitesse: Fix cis8204 RGMII_ID code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Commit 79e86ccb3786c8b20004db3fa10a70049456f580 "vitesse: remove duplicated argument to ||" correctly removed a redundant check. However, I believe that the original code was simply wrong, and should have been checking against RGMII_ID. To fix this and avoid similar problems in the future, use the phy_interface_is_rgmii helper function. Signed-off-by: Phil Edworthy Acked-by: Joe Hershberger --- 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/vitesse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 2635b82..11f4b66 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c @@ -128,9 +128,7 @@ static int cis8204_config(struct phy_device *phydev) genphy_config_aneg(phydev); - if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || - (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) || - (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)) + if (phy_interface_is_rgmii(phydev)) phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS8204_EPHY_CON, MIIM_CIS8204_EPHYCON_INIT | MIIM_CIS8204_EPHYCON_RGMII);