[PATCH RFC 01/10] IB/core: Prepare for immutable device groups

From: Heiner Kallweit

Date: Tue Feb 17 2026 - 17:25:35 EST


This prepares for making struct device member groups a constant array.
No functional change intended.

Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx>
---
drivers/infiniband/core/device.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 1174ab7da62..f967ad534fc 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -565,15 +565,14 @@ static void rdma_init_coredev(struct ib_core_device *coredev,
*/
BUILD_BUG_ON(offsetof(struct ib_device, coredev.dev) !=
offsetof(struct ib_device, dev));
-
- coredev->dev.class = &ib_class;
- coredev->dev.groups = dev->groups;
-
/*
* Don't expose hw counters outside of the init namespace.
*/
if (!is_full_dev && dev->hw_stats_attr_index)
- coredev->dev.groups[dev->hw_stats_attr_index] = NULL;
+ dev->groups[dev->hw_stats_attr_index] = NULL;
+
+ coredev->dev.class = &ib_class;
+ coredev->dev.groups = dev->groups;

device_initialize(&coredev->dev);
coredev->owner = dev;
--
2.53.0