[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1192460472-27099-1-git-send-email-leoli@freescale.com>
Date: Mon, 15 Oct 2007 23:01:12 +0800
From: Li Yang <leoli@...escale.com>
To: jgarzik@...ox.com, netdev@...r.kernel.org
Cc: Li Yang <leoli@...escale.com>
Subject: [PATCH] gianfar: Fix regression caused by new napi interface
Protect all new napi function calls with CONFIG_GFAR_NAPI. Otherwise
the driver will stop working when CONFIG_GFAR_NAPI disabled.
Signed-off-by: Li Yang <leoli@...escale.com>
---
drivers/net/gianfar.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index c15fb1f..cc288d8 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -932,10 +932,14 @@ tx_skb_fail:
/* Returns 0 for success. */
static int gfar_enet_open(struct net_device *dev)
{
+#ifdef CONFIG_GFAR_NAPI
struct gfar_private *priv = netdev_priv(dev);
+#endif
int err;
+#ifdef CONFIG_GFAR_NAPI
napi_enable(&priv->napi);
+#endif
/* Initialize a bunch of registers */
init_registers(dev);
@@ -945,13 +949,17 @@ static int gfar_enet_open(struct net_device *dev)
err = init_phy(dev);
if(err) {
+#ifdef CONFIG_GFAR_NAPI
napi_disable(&priv->napi);
+#endif
return err;
}
err = startup_gfar(dev);
if (err)
+#ifdef CONFIG_GFAR_NAPI
napi_disable(&priv->napi);
+#endif
netif_start_queue(dev);
@@ -1105,7 +1113,9 @@ static int gfar_close(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
+#ifdef CONFIG_GFAR_NAPI
napi_disable(&priv->napi);
+#endif
stop_gfar(dev);
--
1.5.3.2.104.g41ef
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists