Skip to content

Commit

Permalink
dpaa_eth: remove netdev_err() for user errors
Browse files Browse the repository at this point in the history
User reports that an application making an (incorrect) call to
restart AN on a fixed link DPAA interface triggers an error in
the kernel log while the returned EINVAL should be enough.

Reported-by: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Madalin Bucur authored and David S. Miller committed Oct 31, 2019
1 parent 46e93e5 commit 1f722e1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ static char dpaa_stats_global[][ETH_GSTRING_LEN] = {
static int dpaa_get_link_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *cmd)
{
if (!net_dev->phydev) {
netdev_dbg(net_dev, "phy device not initialized\n");
if (!net_dev->phydev)
return 0;
}

phy_ethtool_ksettings_get(net_dev->phydev, cmd);

Expand All @@ -95,10 +93,8 @@ static int dpaa_set_link_ksettings(struct net_device *net_dev,
{
int err;

if (!net_dev->phydev) {
netdev_err(net_dev, "phy device not initialized\n");
if (!net_dev->phydev)
return -ENODEV;
}

err = phy_ethtool_ksettings_set(net_dev->phydev, cmd);
if (err < 0)
Expand Down Expand Up @@ -142,10 +138,8 @@ static int dpaa_nway_reset(struct net_device *net_dev)
{
int err;

if (!net_dev->phydev) {
netdev_err(net_dev, "phy device not initialized\n");
if (!net_dev->phydev)
return -ENODEV;
}

err = 0;
if (net_dev->phydev->autoneg) {
Expand All @@ -167,10 +161,8 @@ static void dpaa_get_pauseparam(struct net_device *net_dev,
priv = netdev_priv(net_dev);
mac_dev = priv->mac_dev;

if (!net_dev->phydev) {
netdev_err(net_dev, "phy device not initialized\n");
if (!net_dev->phydev)
return;
}

epause->autoneg = mac_dev->autoneg_pause;
epause->rx_pause = mac_dev->rx_pause_active;
Expand Down

0 comments on commit 1f722e1

Please sign in to comment.