Skip to content

Commit

Permalink
gianfar: Fix regression caused by new napi interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Yang authored and Jeff Garzik committed Oct 15, 2007
1 parent 20ef2bb commit 293c851
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,14 @@ int startup_gfar(struct net_device *dev)
/* 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);
Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 293c851

Please sign in to comment.