fix version compatibility of alloc_netdev when debug if is enabled

This commit is contained in:
raim.delgado 2022-11-29 09:59:02 +09:00
parent 992e13e782
commit 7bdaca925c
1 changed files with 7 additions and 2 deletions

View File

@ -83,8 +83,13 @@ int ec_debug_init(
memset(&dbg->stats, 0, sizeof(struct net_device_stats));
if (!(dbg->dev =
alloc_netdev(sizeof(ec_debug_t *), name, ether_setup))) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
dbg->dev = alloc_netdev(sizeof(ec_debug_t *), name, NET_NAME_UNKNOWN, ether_setup);
#else
dbg->dev = alloc_netdev(sizeof(ec_debug_t *), name, ether_setup);
#endif
if (!(dbg->dev))
{
EC_MASTER_ERR(device->master, "Unable to allocate net_device"
" for debug object!\n");
return -ENODEV;