net: stmmac: add separate warning for PTP not being supported by HW
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 1 Feb 2017 21:02:02 +0000 (22:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Feb 2017 03:00:48 +0000 (22:00 -0500)
Chips like Amlogic S905GXBB are supported by this driver but don't
have support for PTP. Add a separate warning for missing HW support
to differentiate it from other actual failures.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 26a2185fc8a9ba4a6d25d081ddbbec94e51dff31..bd83bf9ef326948c72954cdf1a81345b9d1bab1e 100644 (file)
@@ -1726,8 +1726,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
 
        if (init_ptp) {
                ret = stmmac_init_ptp(priv);
-               if (ret)
-                       netdev_warn(priv->dev, "fail to init PTP.\n");
+               if (ret == -EOPNOTSUPP)
+                       netdev_warn(priv->dev, "PTP not supported by HW\n");
+               else if (ret)
+                       netdev_warn(priv->dev, "PTP init failed\n");
        }
 
 #ifdef CONFIG_DEBUG_FS