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:
parent
54d0165f68
commit
1e2bcbbb2b
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user