Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139797
b: refs/heads/master
c: 9404c82
h: refs/heads/master
i:
  139795: 81ffcd8
v: v3
  • Loading branch information
Grant Likely authored and David S. Miller committed Apr 2, 2009
1 parent 25ece0d commit 436595b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d360009c100766c6f14ea349e8f984a3ad17e140
refs/heads/master: 9404c82b5ea3237f43732d8afd4d1c0dc8f0f3ed
22 changes: 12 additions & 10 deletions trunk/drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,6 @@ static void mpc52xx_fec_phy_stop(struct net_device *dev)
phy_write(priv->phydev, MII_BMCR, BMCR_PDOWN);
}

static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
struct mii_ioctl_data *mii_data, int cmd)
{
if (!priv->phydev)
return -ENOTSUPP;

return phy_mii_ioctl(priv->phydev, mii_data, cmd);
}

static void mpc52xx_fec_phy_hw_init(struct mpc52xx_fec_priv *priv)
{
struct mpc52xx_fec __iomem *fec = priv->fec;
Expand Down Expand Up @@ -852,12 +843,20 @@ static void mpc52xx_fec_get_drvinfo(struct net_device *dev,
static int mpc52xx_fec_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);

if (!priv->phydev)
return -ENODEV;

return phy_ethtool_gset(priv->phydev, cmd);
}

static int mpc52xx_fec_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);

if (!priv->phydev)
return -ENODEV;

return phy_ethtool_sset(priv->phydev, cmd);
}

Expand Down Expand Up @@ -887,7 +886,10 @@ static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);

return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
if (!priv->phydev)
return -ENOTSUPP;

return phy_mii_ioctl(priv->phydev, if_mii(rq), cmd);
}

static const struct net_device_ops mpc52xx_fec_netdev_ops = {
Expand Down

0 comments on commit 436595b

Please sign in to comment.