summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice
diff options
context:
space:
mode:
authorNatalia Wochtman <natalia.wochtman@intel.com>2026-06-09 14:35:43 -0700
committerJakub Kicinski <kuba@kernel.org>2026-06-13 16:43:46 -0700
commite5652e6d37fecee637a54fb49e60047d9c752079 (patch)
treea9a711cdc123d693bce6f5603f9f0601c27615e3 /drivers/net/ethernet/intel/ice
parent711bdf0b787964a836a40022fe519e608b1d63f3 (diff)
downloadlinux-next-e5652e6d37fecee637a54fb49e60047d9c752079.tar.gz
linux-next-e5652e6d37fecee637a54fb49e60047d9c752079.zip
ice: remove redundant checks from PTP init
Remove unnecessary condition checks in ice_ptp_setup_adapter() and ice_ptp_init(). They are duplicated in ice_pf_src_tmr_owned(). Change ice_ptp_setup_adapter() to return void. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Natalia Wochtman <natalia.wochtman@intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://patch.msgid.link/20260609213559.178657-3-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/intel/ice')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_ptp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 380833a24327..485f63134b6a 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -3058,14 +3058,9 @@ err:
dev_err(ice_pf_to_dev(pf), "PTP reset failed %d\n", err);
}
-static int ice_ptp_setup_adapter(struct ice_pf *pf)
+static void ice_ptp_setup_adapter(struct ice_pf *pf)
{
- if (!ice_pf_src_tmr_owned(pf) || !ice_is_primary(&pf->hw))
- return -EPERM;
-
pf->adapter->ctrl_pf = pf;
-
- return 0;
}
static int ice_ptp_setup_pf(struct ice_pf *pf)
@@ -3323,10 +3318,9 @@ void ice_ptp_init(struct ice_pf *pf)
/* If this function owns the clock hardware, it must allocate and
* configure the PTP clock device to represent it.
*/
- if (ice_pf_src_tmr_owned(pf) && ice_is_primary(hw)) {
- err = ice_ptp_setup_adapter(pf);
- if (err)
- goto err_exit;
+ if (ice_pf_src_tmr_owned(pf)) {
+ ice_ptp_setup_adapter(pf);
+
err = ice_ptp_init_owner(pf);
if (err)
goto err_exit;