diff mbox

[5/6,NET] ixp2000/enp2611: don't set non-existent member get_stats

Message ID 1249677761-19470-5-git-send-email-u.kleine-koenig@pengutronix.de
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Uwe Kleine-König Aug. 7, 2009, 8:42 p.m. UTC
This fixes a build failure for 2.6.31-rc5 (ARCH=arm, ixp2000_defconfig):

	  CC      drivers/net/ixp2000/enp2611.o
	drivers/net/ixp2000/enp2611.c: In function 'enp2611_init_module':
	drivers/net/ixp2000/enp2611.c:213: error: 'struct net_device' has no member named 'get_stats'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: netdev@vger.kernel.org
---
Hello,

obviously this has the downside that the stats won't work, I let the fix
for someone else :-)

Best regards
Uwe
---
 drivers/net/ixp2000/enp2611.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller Aug. 10, 2009, 4:49 a.m. UTC | #1
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Fri,  7 Aug 2009 22:42:40 +0200

> This fixes a build failure for 2.6.31-rc5 (ARCH=arm, ixp2000_defconfig):
> 
> 	  CC      drivers/net/ixp2000/enp2611.o
> 	drivers/net/ixp2000/enp2611.c: In function 'enp2611_init_module':
> 	drivers/net/ixp2000/enp2611.c:213: error: 'struct net_device' has no member named 'get_stats'
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This is far from the way to fix this, unfortunately.

We need to find a way to propagate this assignment into
the netdev_ops method vector instead.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Uwe Kleine-König Aug. 10, 2009, 9:40 a.m. UTC | #2
Hello,

On Sun, Aug 09, 2009 at 09:49:06PM -0700, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Fri,  7 Aug 2009 22:42:40 +0200
> 
> > This fixes a build failure for 2.6.31-rc5 (ARCH=arm, ixp2000_defconfig):
> > 
> > 	  CC      drivers/net/ixp2000/enp2611.o
> > 	drivers/net/ixp2000/enp2611.c: In function 'enp2611_init_module':
> > 	drivers/net/ixp2000/enp2611.c:213: error: 'struct net_device' has no member named 'get_stats'
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This is far from the way to fix this, unfortunately.
> 
> We need to find a way to propagate this assignment into
> the netdev_ops method vector instead.
Yes, I tried that, but stopped when I saw it's declared const.  I don't
know if this is required.  If yes then the only way to fix it is to add
a platform callback that is called if non-NULL.

I don't want to invest time here without a word by the maintainers
though.

Best regards
Uwe
David Miller Aug. 10, 2009, 3 p.m. UTC | #3
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Mon, 10 Aug 2009 11:40:27 +0200

> Yes, I tried that, but stopped when I saw it's declared const.  I don't
> know if this is required.  If yes then the only way to fix it is to add
> a platform callback that is called if non-NULL.

The easiest way to handle this is to have another copy of the ops,
which has the other get_stats member value, and to assign that as
the netdev_ops when the relevant condition holds.

> I don't want to invest time here without a word by the maintainers
> though.

But we can't apply the patch you initially posted, that's for sure
:-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c
index b02a981..d6ef176 100644
--- a/drivers/net/ixp2000/enp2611.c
+++ b/drivers/net/ixp2000/enp2611.c
@@ -210,7 +210,7 @@  static int __init enp2611_init_module(void)
 			return -ENOMEM;
 		}
 
-		nds[i]->get_stats = enp2611_get_stats;
+		/* nds[i]->get_stats = enp2611_get_stats; */
 		pm3386_init_port(i);
 		pm3386_get_mac(i, nds[i]->dev_addr);
 	}