Date: Fri, 4 Mar 2016 14:23:34 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296385 - head/sys/dev/e1000 Message-ID: <201603041423.u24ENYTq002153@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sbruno Date: Fri Mar 4 14:23:34 2016 New Revision: 296385 URL: https://svnweb.freebsd.org/changeset/base/296385 Log: The register read/write mphy functions have misleading whitespace around the locked check. This cleanup merely preserves the existing functionality while improving the ready check. Submitted by: Jim Thompson Reviewed by: gnn erj Obtained from: Netgate MFC after: 2 weeks Sponsored by: Netgate Differential Revision: https://reviews.freebsd.org/D5448 Modified: head/sys/dev/e1000/e1000_phy.c Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Fri Mar 4 13:58:39 2016 (r296384) +++ head/sys/dev/e1000/e1000_phy.c Fri Mar 4 14:23:34 2016 (r296385) @@ -4146,13 +4146,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) + if (locked) { ready = e1000_is_mphy_ready(hw); if (!ready) return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); - + } + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; } @@ -4211,13 +4210,12 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) + if (locked) { ready = e1000_is_mphy_ready(hw); if (!ready) return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); - + } + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603041423.u24ENYTq002153>