RDMA/bnxt_re: Refactor device add/remove functionalities
authorSelvin Xavier <selvin.xavier@broadcom.com>
Wed, 26 Feb 2020 15:45:31 +0000 (07:45 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 2 Mar 2020 15:10:37 +0000 (11:10 -0400)
commitc2b777a9592395bf68f17bcfa76813eb507a001c
tree87c826f251935c74771342bdf31c4d6782a7bf4c
parentff6629f88c529b07d9704c656c64dae76910e3e9
RDMA/bnxt_re: Refactor device add/remove functionalities

 - bnxt_re_ib_reg() handles two main functionalities - initializing the
   device and registering with the IB stack.  Split it into 2 functions
   i.e. bnxt_re_dev_init() and bnxt_re_ib_init() to account for the same
   thereby improve modularity. Do the same for
   bnxt_re_ib_unreg()i.e. split into two functions - bnxt_re_dev_uninit()
   and bnxt_re_ib_uninit().

 - Simplify the code by combining the different steps to add and remove
   the device into two functions.

 - Report correct netdev link state during device register

Link: https://lore.kernel.org/r/1582731932-26574-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/main.c