]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: fix build error in init_dummy_netdev
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 25 Sep 2010 11:22:17 +0000 (13:22 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 25 Sep 2010 21:53:32 +0000 (14:53 -0700)
In kernel <= 2.6.28 the member napi_list in struct net_device is only
availabe if CONFIG_NETPOLL is set. We should initialize it only if it
is available.

This should fix the problem reported by Philip.

This should also go into stable.

CC: philipp_subx@redfish-solutions.com
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
compat/compat-2.6.29.c

index bc4288f4469f66b71eb5de6394a911282d9d19be..cded3cc01a10441e7e531f9a7fe8f72931c6aaaa 100644 (file)
@@ -153,8 +153,10 @@ int init_dummy_netdev(struct net_device *dev)
        /* initialize the ref count */
        atomic_set(&dev->refcnt, 1);
 
+#ifdef CONFIG_NETPOLL
        /* NAPI wants this */
        INIT_LIST_HEAD(&dev->napi_list);
+#endif
 
        /* a dummy interface is started by default */
        set_bit(__LINK_STATE_PRESENT, &dev->state);