Remove aliasing support for kernels < 4.15

pull/10/head
Paul Hollinsky 2019-08-27 12:53:44 -04:00
parent a9233ab3a2
commit 408459cbe2
1 changed files with 2 additions and 0 deletions

View File

@ -349,6 +349,7 @@ static int intrepid_add_can_if(struct intrepid_netdevice **result, const char *r
dev->max_mtu = CANFD_MTU; dev->max_mtu = CANFD_MTU;
dev->mtu = CANFD_MTU; /* TODO: Check CAN-FD support from usermode daemon */ dev->mtu = CANFD_MTU; /* TODO: Check CAN-FD support from usermode daemon */
dev->netdev_ops = &intrepid_netdevice_ops; dev->netdev_ops = &intrepid_netdevice_ops;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
if (requestedName && ((aliasLen = strlen(requestedName)) > 0) && aliasLen < IFALIASZ) { if (requestedName && ((aliasLen = strlen(requestedName)) > 0) && aliasLen < IFALIASZ) {
dev->ifalias = kzalloc(sizeof(struct dev_ifalias) + aliasLen + 1, GFP_KERNEL); dev->ifalias = kzalloc(sizeof(struct dev_ifalias) + aliasLen + 1, GFP_KERNEL);
if (dev->ifalias == NULL) { if (dev->ifalias == NULL) {
@ -358,6 +359,7 @@ static int intrepid_add_can_if(struct intrepid_netdevice **result, const char *r
pr_info("intrepid: %s alias set to %s\n", dev->name, requestedName); pr_info("intrepid: %s alias set to %s\n", dev->name, requestedName);
} }
} }
#endif
ics = netdev_priv(dev); ics = netdev_priv(dev);
ics->dev = dev; ics->dev = dev;
ics->is_stopped = 0; ics->is_stopped = 0;