aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichal Simek2015-11-30 13:44:49 +0100
committerMichal Simek2015-12-07 09:59:04 +0100
commit64a7ead64bdb965c648df1fc34143e203b1d979a (patch)
treeb3b35d7351c7b636a06c813a83e4df00ea20e727 /drivers/net
parentf2fc27684f4d1f4e0395fcb90a8e5451aeabc2b8 (diff)
net: gem: Remove phydev variable
Resort code to use priv->phydev variable directly. It will simplify move to DM. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/zynq_gem.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 65ea5deb23c..8f3fe913006 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -315,7 +315,6 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
u32 i;
int ret;
unsigned long clk_rate = 0;
- struct phy_device *phydev;
struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
struct zynq_gem_priv *priv = dev->priv;
struct emac_bd *dummy_tx_bd = &priv->tx_bd[TX_FREE_DESC];
@@ -394,23 +393,21 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
return ret;
}
- /* interface - look at tsec */
- phydev = phy_connect(priv->bus, priv->phyaddr, dev,
- priv->interface);
+ priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev,
+ priv->interface);
- phydev->supported = supported | ADVERTISED_Pause |
- ADVERTISED_Asym_Pause;
- phydev->advertising = phydev->supported;
- priv->phydev = phydev;
- phy_config(phydev);
- phy_startup(phydev);
+ priv->phydev->supported = supported | ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause;
+ priv->phydev->advertising = priv->phydev->supported;
+ phy_config(priv->phydev);
+ phy_startup(priv->phydev);
- if (!phydev->link) {
- printf("%s: No link.\n", phydev->dev->name);
+ if (!priv->phydev->link) {
+ printf("%s: No link.\n", priv->phydev->dev->name);
return -1;
}
- switch (phydev->speed) {
+ switch (priv->phydev->speed) {
case SPEED_1000:
writel(ZYNQ_GEM_NWCFG_INIT | ZYNQ_GEM_NWCFG_SPEED1000,
&regs->nwcfg);