Merge branch 'stable-1.5' into 'stable-1.5'

fix version compatibility of alloc_netdev when debug if is enabled

See merge request etherlab.org/ethercat!62
This commit is contained in:
Florian Pose 2023-03-14 15:59:31 +00:00
commit c022ddbcf2
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;