diff options
author | Li Yang <leoli@freescale.com> | 2007-10-15 11:01:12 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-15 14:41:34 -0400 |
commit | 293c8513398657f6263fcdb03c87f2760cf61be4 (patch) | |
tree | 9c345b9c12a02e57d70a01bb881e5f7f9f91ce75 /drivers/net/gianfar.c | |
parent | 20ef2bb0085a53e2b040c9e3016799e058a761c4 (diff) |
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@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | 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 15099505915d..558440c15b6c 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -932,10 +932,14 @@ tx_skb_fail: | |||
932 | /* Returns 0 for success. */ | 932 | /* Returns 0 for success. */ |
933 | static int gfar_enet_open(struct net_device *dev) | 933 | static int gfar_enet_open(struct net_device *dev) |
934 | { | 934 | { |
935 | #ifdef CONFIG_GFAR_NAPI | ||
935 | struct gfar_private *priv = netdev_priv(dev); | 936 | struct gfar_private *priv = netdev_priv(dev); |
937 | #endif | ||
936 | int err; | 938 | int err; |
937 | 939 | ||
940 | #ifdef CONFIG_GFAR_NAPI | ||
938 | napi_enable(&priv->napi); | 941 | napi_enable(&priv->napi); |
942 | #endif | ||
939 | 943 | ||
940 | /* Initialize a bunch of registers */ | 944 | /* Initialize a bunch of registers */ |
941 | init_registers(dev); | 945 | init_registers(dev); |
@@ -945,13 +949,17 @@ static int gfar_enet_open(struct net_device *dev) | |||
945 | err = init_phy(dev); | 949 | err = init_phy(dev); |
946 | 950 | ||
947 | if(err) { | 951 | if(err) { |
952 | #ifdef CONFIG_GFAR_NAPI | ||
948 | napi_disable(&priv->napi); | 953 | napi_disable(&priv->napi); |
954 | #endif | ||
949 | return err; | 955 | return err; |
950 | } | 956 | } |
951 | 957 | ||
952 | err = startup_gfar(dev); | 958 | err = startup_gfar(dev); |
953 | if (err) | 959 | if (err) |
960 | #ifdef CONFIG_GFAR_NAPI | ||
954 | napi_disable(&priv->napi); | 961 | napi_disable(&priv->napi); |
962 | #endif | ||
955 | 963 | ||
956 | netif_start_queue(dev); | 964 | netif_start_queue(dev); |
957 | 965 | ||
@@ -1105,7 +1113,9 @@ static int gfar_close(struct net_device *dev) | |||
1105 | { | 1113 | { |
1106 | struct gfar_private *priv = netdev_priv(dev); | 1114 | struct gfar_private *priv = netdev_priv(dev); |
1107 | 1115 | ||
1116 | #ifdef CONFIG_GFAR_NAPI | ||
1108 | napi_disable(&priv->napi); | 1117 | napi_disable(&priv->napi); |
1118 | #endif | ||
1109 | 1119 | ||
1110 | stop_gfar(dev); | 1120 | stop_gfar(dev); |
1111 | 1121 | ||