mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
modules/mqnic: Call devlink_register earlier
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
parent
1e2bcbbb2b
commit
c2d6942233
@ -245,6 +245,12 @@ static int mqnic_common_probe(struct mqnic_dev *mqnic)
|
|||||||
|
|
||||||
int k = 0, l = 0;
|
int k = 0, l = 0;
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||||
|
devlink_register(devlink);
|
||||||
|
#else
|
||||||
|
devlink_register(devlink, dev);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Enumerate registers
|
// Enumerate registers
|
||||||
mqnic->rb_list = mqnic_enumerate_reg_block_list(mqnic->hw_addr, 0, mqnic->hw_regs_size);
|
mqnic->rb_list = mqnic_enumerate_reg_block_list(mqnic->hw_addr, 0, mqnic->hw_regs_size);
|
||||||
if (!mqnic->rb_list) {
|
if (!mqnic->rb_list) {
|
||||||
@ -441,11 +447,6 @@ fail_create_if:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// probe complete
|
// probe complete
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
|
||||||
devlink_register(devlink);
|
|
||||||
#else
|
|
||||||
devlink_register(devlink, dev);
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// error handling
|
// error handling
|
||||||
@ -465,8 +466,6 @@ static void mqnic_common_remove(struct mqnic_dev *mqnic)
|
|||||||
struct devlink *devlink = priv_to_devlink(mqnic);
|
struct devlink *devlink = priv_to_devlink(mqnic);
|
||||||
int k = 0;
|
int k = 0;
|
||||||
|
|
||||||
devlink_unregister(devlink);
|
|
||||||
|
|
||||||
#ifdef CONFIG_AUXILIARY_BUS
|
#ifdef CONFIG_AUXILIARY_BUS
|
||||||
if (mqnic->app_adev) {
|
if (mqnic->app_adev) {
|
||||||
auxiliary_device_delete(&mqnic->app_adev->adev);
|
auxiliary_device_delete(&mqnic->app_adev->adev);
|
||||||
@ -494,6 +493,8 @@ static void mqnic_common_remove(struct mqnic_dev *mqnic)
|
|||||||
}
|
}
|
||||||
if (mqnic->rb_list)
|
if (mqnic->rb_list)
|
||||||
mqnic_free_reg_block_list(mqnic->rb_list);
|
mqnic_free_reg_block_list(mqnic->rb_list);
|
||||||
|
|
||||||
|
devlink_unregister(devlink);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user