OSDN Git Service

ice: split probe into smaller functions
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Wed, 21 Dec 2022 11:38:18 +0000 (12:38 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 3 Feb 2023 17:54:18 +0000 (09:54 -0800)
commit5b246e533d0177775c64b40a2af1e62aff5d279b
tree7cab5297ca2bca6a2f766b79014bf0cb3aa28d8d
parenta696d61528f08d2fac221dcb618495f43cccdcb3
ice: split probe into smaller functions

Part of code from probe can be reused in reload flow. Move this code to
separate function. Create unroll functions for each part of
initialization, like: ice_init_dev() and ice_deinit_dev(). It
simplifies unrolling and can be used in remove flow.

Avoid freeing port info as it could be reused in reload path.
Will be freed in remove path since is allocated via devm_kzalloc().

Also clean the remove path to reflect the init steps.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice.h
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_main.c