RDMA/core: make ib_device.add method optional
authorSagi Grimberg <sagi@grimberg.me>
Sun, 2 Jul 2017 08:20:50 +0000 (11:20 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 18 Aug 2017 14:46:20 +0000 (10:46 -0400)
commitb059e2108d7ac2d63001735f11d79ee670d9e3fe
treee58b6184b0592e79383f4f28f9f0550a9c96f037
parent836daee2df01b79e9cf54b80b985aea6cff05f57
RDMA/core: make ib_device.add method optional

ib_clients can indeed fill .add to NULL, but then they will not see
any device removal notifications. The reason is that that
ib_register_client and ib_register_device checked existence of .add
before adding the creating a corresponding client_data and adding
it to the list. Simple condition reverse fixes the issue.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/device.c