RDMA/core: Depend on device_add() to add device attributes

Instead of adding/removing device attribute files, depend on device_add()
which considers adding these device files based on NULL terminated
attributes group array.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Parav Pandit
2018-09-05 09:47:58 +03:00
committed by Jason Gunthorpe
parent 08e74be103
commit adee9f3f3b
2 changed files with 29 additions and 33 deletions

View File

@@ -2536,6 +2536,9 @@ struct ib_device {
struct module *owner;
struct device dev;
/* First group for device attributes, NULL terminated array */
const struct attribute_group *groups[2];
struct kobject *ports_parent;
struct list_head port_list;