IB/ipoib: Move init code to ndo_init
authorJason Gunthorpe <jgg@mellanox.com>
Sun, 29 Jul 2018 08:34:55 +0000 (11:34 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 3 Aug 2018 02:27:43 +0000 (20:27 -0600)
commiteaeb398425089cb3c8edc81a406109db94b2705c
treec4fd8b3b2af8574264f5b7549bcbd072c237bda2
parent7cbee87c17965ede0eba2e7ba41d0a38ebd2249c
IB/ipoib: Move init code to ndo_init

Now that we have a proper ndo_uninit, move code that naturally pairs
with the ndo_uninit into ndo_init. This allows the netdev core to natually
handle ordering.

This fixes the situation where register_netdev can fail before calling
ndo_init, in which case it wouldn't call ndo_uninit either.

Also move a bunch of duplicated init code that is shared between child
and parent for clarity. Now the child and parent register functions look
very similar.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/ipoib/ipoib_netlink.c
drivers/infiniband/ulp/ipoib/ipoib_vlan.c