Skip to contentSkip to conversation

PHYLIB/gianfar: Use phy_ethtool_get_link() for get_link op

PATCH NAK Nathaniel Case 2 participants 5 messages Jun 5, 2006 – Jun 8, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 PHYLIB/gianfar: Use phy_ethtool_get_link() for get_link op

This patch makes the gianfar ethtool code use phy_ethtool_get_link() instead of ethtool_op_get_link().

Patch depends on previous one (1/2).

---

drivers/net/gianfar_ethtool.c +13 -1
@@ -228,6 +228,18 @@
 		buf[i] = gfar_read(&theregs[i]);
 }
 
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return -ENODEV;
+
+	return phy_ethtool_get_link(phydev);
+}
+
+
 /* Convert microseconds to ethernet clock ticks, which changes
  * depending on what speed the controller is running at */
 static unsigned int gfar_usecs2ticks(struct gfar_private *priv, unsigned int usecs)
@@ -574,7 +578,7 @@
 	.get_drvinfo = gfar_gdrvinfo,
 	.get_regs_len = gfar_reglen,
 	.get_regs = gfar_get_regs,
-	.get_link = ethtool_op_get_link,
+	.get_link = gfar_get_link,
 	.get_coalesce = gfar_gcoalesce,
 	.set_coalesce = gfar_scoalesce,
 	.get_ringparam = gfar_gringparam,
#1 lore raw
Quoted 12 lines · Nathaniel Case

This patch makes the gianfar ethtool code use phy_ethtool_get_link() instead of ethtool_op_get_link().

Patch depends on previous one (1/2).

---

drivers/net/gianfar_ethtool.c line 237

Quoted 10 lines
drivers/net/gianfar_ethtool.c +7 -0
@@ -228,6 +228,18 @@
 		buf[i] = gfar_read(&theregs[i]);
 }
 
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return -ENODEV;

NAK, return code obviously wrong

#2 lore raw
Quoted 9 lines · Jeff Garzik

Review

Quoted 7 lines
(quoted diff) +7 -0
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return -ENODEV;

NAK, return code obviously wrong

Thanks. I think we can just return 0 for that case. Updated patch follows.

drivers/net/gianfar_ethtool.c +13 -1
@@ -228,6 +228,18 @@
 		buf[i] = gfar_read(&theregs[i]);
 }
 
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return 0;
+
+	return phy_ethtool_get_link(phydev);
+}
+
+
 /* Convert microseconds to ethernet clock ticks, which changes
  * depending on what speed the controller is running at */
 static unsigned int gfar_usecs2ticks(struct gfar_private *priv, unsigned int usecs)
@@ -574,7 +578,7 @@
 	.get_drvinfo = gfar_gdrvinfo,
 	.get_regs_len = gfar_reglen,
 	.get_regs = gfar_get_regs,
-	.get_link = ethtool_op_get_link,
+	.get_link = gfar_get_link,
 	.get_coalesce = gfar_gcoalesce,
 	.set_coalesce = gfar_scoalesce,
 	.get_ringparam = gfar_gringparam,
#3 lore raw
Quoted 10 lines · Nathaniel Case
Quoted 8 lines · Jeff Garzik

drivers/net/gianfar_ethtool.c

Quoted 7 lines
drivers/net/gianfar_ethtool.c +7 -0
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return -ENODEV;

NAK, return code obviously wrong

Quoted 4 lines

Thanks. I think we can just return 0 for that case. Updated patch follows.

Sigh. See rule #6: http://linux.yyz.us/patch-format.html

You excised the patch description, which means your patch can no longer be applied correctly by scripts.

Jeff

#4 lore raw

This patch makes the gianfar ethtool code use phy_ethtool_get_link() instead of ethtool_op_get_link().

---

drivers/net/gianfar_ethtool.c +13 -1
@@ -228,6 +228,18 @@
 		buf[i] = gfar_read(&theregs[i]);
 }
 
+static u32 gfar_get_link(struct net_device *dev)
+{
+	struct gfar_private *priv = netdev_priv(dev);
+	struct phy_device *phydev = priv->phydev;
+
+	if (NULL == phydev)
+		return 0;
+
+	return phy_ethtool_get_link(phydev);
+}
+
+
 /* Convert microseconds to ethernet clock ticks, which changes
  * depending on what speed the controller is running at */
 static unsigned int gfar_usecs2ticks(struct gfar_private *priv, unsigned int usecs)
@@ -574,7 +578,7 @@
 	.get_drvinfo = gfar_gdrvinfo,
 	.get_regs_len = gfar_reglen,
 	.get_regs = gfar_get_regs,
-	.get_link = ethtool_op_get_link,
+	.get_link = gfar_get_link,
 	.get_coalesce = gfar_gcoalesce,
 	.set_coalesce = gfar_scoalesce,
 	.get_ringparam = gfar_gringparam,