summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2019-02-13 19:23:03 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-02-15 21:42:02 -0700
commite155755e53804e721c8ce99474cc9c65eb8e8bc2 (patch)
tree871d2204600ebcb8299ee10cc95bce81ac03d156 /drivers/infiniband/core/device.c
parentcfe876d8e6b0491170d44c8040c518b121957104 (diff)
RDMA/core: Use simpler device_del() instead of device_unregister()
Instead of holding extra reference using get_device() that device_unregister() releases, simplify it as below. device_add() balances with device_del(). device_initialize() balances with put_device(), always via ib_dealloc_device(). Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 3325be4f91a5..46d237ce83de 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -369,6 +369,7 @@ void ib_dealloc_device(struct ib_device *device)
WARN_ON(!xa_empty(&device->client_data));
WARN_ON(refcount_read(&device->refcount));
rdma_restrack_clean(device);
+ /* Balances with device_initialize */
put_device(&device->dev);
}
EXPORT_SYMBOL(ib_dealloc_device);