1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

modules/mqnic: Add devlink kernel version ifdefs

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-09-13 18:27:57 -07:00
parent 54d0165f68
commit 1e2bcbbb2b
2 changed files with 8 additions and 0 deletions

View File

@ -90,7 +90,11 @@ static const struct devlink_ops mqnic_devlink_ops = {
struct devlink *mqnic_devlink_alloc(struct device *dev) struct devlink *mqnic_devlink_alloc(struct device *dev)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
return devlink_alloc(&mqnic_devlink_ops, sizeof(struct mqnic_dev), dev); return devlink_alloc(&mqnic_devlink_ops, sizeof(struct mqnic_dev), dev);
#else
return devlink_alloc(&mqnic_devlink_ops, sizeof(struct mqnic_dev));
#endif
} }
void mqnic_devlink_free(struct devlink *devlink) void mqnic_devlink_free(struct devlink *devlink)

View File

@ -441,7 +441,11 @@ fail_create_if:
#endif #endif
// probe complete // probe complete
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
devlink_register(devlink); devlink_register(devlink);
#else
devlink_register(devlink, dev);
#endif
return 0; return 0;
// error handling // error handling