nfp: add nfp_app cleanup callback and make flower use it
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 27 Jun 2017 07:50:19 +0000 (00:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jun 2017 19:48:47 +0000 (15:48 -0400)
commit9ce6bbbb0503e58e8629ae0185e916b271237bc3
treec0401e79f9b4f45c5f020b72e449210fe6a0d711
parent8a119cef9a84c396c7de49da2fb4b8af09e96d2b
nfp: add nfp_app cleanup callback and make flower use it

Add a cleanup callback for undoing what app init callback did.
Make flower allocate its private structure on init and free
it from the new callback.

While at it remember to set the app pointer to NULL on the
error path to avoid any races while probe path unwinds.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/main.c
drivers/net/ethernet/netronome/nfp/nfp_app.h
drivers/net/ethernet/netronome/nfp/nfp_net_main.c