aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 3e1a57a42f11..c83bd6560088 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -894,14 +894,21 @@ static void fs_get_regs(struct net_device *dev, struct ethtool_regs *regs,
894static int fs_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 894static int fs_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
895{ 895{
896 struct fs_enet_private *fep = netdev_priv(dev); 896 struct fs_enet_private *fep = netdev_priv(dev);
897
898 if (!fep->phydev)
899 return -ENODEV;
900
897 return phy_ethtool_gset(fep->phydev, cmd); 901 return phy_ethtool_gset(fep->phydev, cmd);
898} 902}
899 903
900static int fs_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 904static int fs_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
901{ 905{
902 struct fs_enet_private *fep = netdev_priv(dev); 906 struct fs_enet_private *fep = netdev_priv(dev);
903 phy_ethtool_sset(fep->phydev, cmd); 907
904 return 0; 908 if (!fep->phydev)
909 return -ENODEV;
910
911 return phy_ethtool_sset(fep->phydev, cmd);
905} 912}
906 913
907static int fs_nway_reset(struct net_device *dev) 914static int fs_nway_reset(struct net_device *dev)