aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/devlink/devlink.c
diff options
context:
space:
mode:
authorPrzemek Kitszel <[email protected]>2024-10-02 11:50:22 +0000
committerTony Nguyen <[email protected]>2025-01-14 22:37:34 +0000
commit4d3f59bfa2cd3193b8bbe724df0a9cd41bdc507d (patch)
tree2f1c8134c6c4833686a49aa135d31124515b65e2 /drivers/net/ethernet/intel/ice/devlink/devlink.c
parentice: c827: move wait for FW to ice_init_hw() (diff)
downloadkernel-4d3f59bfa2cd3193b8bbe724df0a9cd41bdc507d.tar.gz
kernel-4d3f59bfa2cd3193b8bbe724df0a9cd41bdc507d.zip
ice: split ice_init_hw() out from ice_init_dev()
Split ice_init_hw() call out from ice_init_dev(). Such move enables pulling the former to be even earlier on call path, what would enable moving ice_adapter init to be between the two (in subsequent commit). Such move enables ice_adapter to know about number of PFs. Do the same for ice_deinit_hw(), so the init and deinit calls could be easily mirrored. Next commit will rename unrelated goto labels to unroll prefix. Reviewed-by: Marcin Szycik <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/devlink/devlink.c')
-rw-r--r--drivers/net/ethernet/intel/ice/devlink/devlink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
index 1b10682c00b8..d1b9ccec5e05 100644
--- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
+++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
@@ -1207,9 +1207,15 @@ static int ice_devlink_reinit_up(struct ice_pf *pf)
struct ice_vsi *vsi = ice_get_main_vsi(pf);
int err;
+ err = ice_init_hw(&pf->hw);
+ if (err) {
+ dev_err(ice_pf_to_dev(pf), "ice_init_hw failed: %d\n", err);
+ return err;
+ }
+
err = ice_init_dev(pf);
if (err)
- return err;
+ goto unroll_hw_init;
vsi->flags = ICE_VSI_FLAG_INIT;
@@ -1232,6 +1238,8 @@ err_load:
rtnl_unlock();
err_vsi_cfg:
ice_deinit_dev(pf);
+unroll_hw_init:
+ ice_deinit_hw(&pf->hw);
return err;
}