From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathaniel Case Subject: Re: [PATCH 2/2] PHYLIB/gianfar: Use phy_ethtool_get_link() for get_link op Date: Thu, 08 Jun 2006 10:18:59 -0500 Message-ID: <1149779939.30343.7.camel@localhost.localdomain> References: <1149551334.10700.48.camel@localhost.localdomain> <44883B0E.5090802@garzik.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andy Fleming , netdev@vger.kernel.org, galak@kernel.crashing.org Return-path: Received: from xes-mad.com ([216.165.139.214]:4838 "EHLO xes-mad.com") by vger.kernel.org with ESMTP id S964862AbWFHPTQ (ORCPT ); Thu, 8 Jun 2006 11:19:16 -0400 To: Jeff Garzik In-Reply-To: <44883B0E.5090802@garzik.org> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, 2006-06-08 at 10:58 -0400, Jeff Garzik wrote: > > +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. Signed-off-by: Nate Case --- a/drivers/net/gianfar_ethtool.c 2006-06-05 11:27:19.000000000 -0500 +++ b/drivers/net/gianfar_ethtool.c 2006-06-04 19:31:01.000000000 -0500 @@ -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,