aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
diff options
context:
space:
mode:
authorIyappan Subramanian <isubramanian@apm.com>2017-05-18 15:13:44 -0700
committerDavid S. Miller <davem@davemloft.net>2017-05-19 19:41:43 -0400
commit326dde3e3b2ed05e5882e4401368d0f5d8861da7 (patch)
tree6f6298fa6aced40f67528f93505c4fab73dad8d7 /drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
parentphy: Add helper function to check phy interface mode (diff)
downloadlinux-dev-326dde3e3b2ed05e5882e4401368d0f5d8861da7.tar.xz
linux-dev-326dde3e3b2ed05e5882e4401368d0f5d8861da7.zip
xgene: Check all RGMII phy mode variants
This patch addresses the review comment from the previous patch set, by using phy_interface_mode_is_rgmii() helper function to address all RGMII phy mode variants. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_hw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
index 6ac27c7522a7..e45b587c2994 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
@@ -272,7 +272,7 @@ void xgene_enet_wr_mac(struct xgene_enet_pdata *pdata, u32 wr_addr, u32 wr_data)
u32 done;
if (pdata->mdio_driver && ndev->phydev &&
- pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) {
+ phy_interface_mode_is_rgmii(pdata->phy_mode)) {
struct mii_bus *bus = ndev->phydev->mdio.bus;
return xgene_mdio_wr_mac(bus->priv, wr_addr, wr_data);
@@ -326,12 +326,13 @@ static void xgene_enet_rd_mcx_csr(struct xgene_enet_pdata *pdata,
u32 xgene_enet_rd_mac(struct xgene_enet_pdata *pdata, u32 rd_addr)
{
void __iomem *addr, *rd, *cmd, *cmd_done;
+ struct net_device *ndev = pdata->ndev;
u32 done, rd_data;
u8 wait = 10;
- if (pdata->mdio_driver && pdata->ndev->phydev &&
- pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) {
- struct mii_bus *bus = pdata->ndev->phydev->mdio.bus;
+ if (pdata->mdio_driver && ndev->phydev &&
+ phy_interface_mode_is_rgmii(pdata->phy_mode)) {
+ struct mii_bus *bus = ndev->phydev->mdio.bus;
return xgene_mdio_rd_mac(bus->priv, rd_addr);
}
@@ -349,8 +350,7 @@ u32 xgene_enet_rd_mac(struct xgene_enet_pdata *pdata, u32 rd_addr)
udelay(1);
if (!done)
- netdev_err(pdata->ndev, "mac read failed, addr: %04x\n",
- rd_addr);
+ netdev_err(ndev, "mac read failed, addr: %04x\n", rd_addr);
rd_data = ioread32(rd);
iowrite32(0, cmd);