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>
This commit is contained in:
parent
20ef2bb008
commit
293c851339
|
@ -932,10 +932,14 @@ tx_skb_fail:
|
||||||
/* Returns 0 for success. */
|
/* Returns 0 for success. */
|
||||||
static int gfar_enet_open(struct net_device *dev)
|
static int gfar_enet_open(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_GFAR_NAPI
|
||||||
struct gfar_private *priv = netdev_priv(dev);
|
struct gfar_private *priv = netdev_priv(dev);
|
||||||
|
#endif
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
#ifdef CONFIG_GFAR_NAPI
|
||||||
napi_enable(&priv->napi);
|
napi_enable(&priv->napi);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize a bunch of registers */
|
/* Initialize a bunch of registers */
|
||||||
init_registers(dev);
|
init_registers(dev);
|
||||||
|
@ -945,13 +949,17 @@ static int gfar_enet_open(struct net_device *dev)
|
||||||
err = init_phy(dev);
|
err = init_phy(dev);
|
||||||
|
|
||||||
if(err) {
|
if(err) {
|
||||||
|
#ifdef CONFIG_GFAR_NAPI
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
|
#endif
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = startup_gfar(dev);
|
err = startup_gfar(dev);
|
||||||
if (err)
|
if (err)
|
||||||
|
#ifdef CONFIG_GFAR_NAPI
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
|
#endif
|
||||||
|
|
||||||
netif_start_queue(dev);
|
netif_start_queue(dev);
|
||||||
|
|
||||||
|
@ -1105,7 +1113,9 @@ static int gfar_close(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct gfar_private *priv = netdev_priv(dev);
|
struct gfar_private *priv = netdev_priv(dev);
|
||||||
|
|
||||||
|
#ifdef CONFIG_GFAR_NAPI
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
|
#endif
|
||||||
|
|
||||||
stop_gfar(dev);
|
stop_gfar(dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue