RDMA/core: Replace open-coded variant of put_device
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 1 Jan 2018 11:07:13 +0000 (13:07 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 2 Jan 2018 20:36:57 +0000 (13:36 -0700)
There is an existing function to decrease reference counter
of the device, let's use it.

Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c

index 21302e077be121354f09ccaed5e4ae5193c87760..a8757b5552de1de6a41a62fabcb5700c735c77b0 100644 (file)
@@ -272,7 +272,7 @@ void ib_dealloc_device(struct ib_device *device)
 {
        WARN_ON(device->reg_state != IB_DEV_UNREGISTERED &&
                device->reg_state != IB_DEV_UNINITIALIZED);
-       kobject_put(&device->dev.kobj);
+       put_device(&device->dev);
 }
 EXPORT_SYMBOL(ib_dealloc_device);