From: Natalia Wochtman <natalia.wochtman@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, grzegorz.nitka@intel.com,
przemyslaw.kitszel@intel.com, aleksandr.loktionov@intel.com,
Natalia Wochtman <natalia.wochtman@intel.com>
Subject: [PATCH iwl-next v1] ice: remove redundant checks from PTP init
Date: Wed, 25 Feb 2026 10:02:36 +0100 [thread overview]
Message-ID: <20260225090236.187255-1-natalia.wochtman@intel.com> (raw)
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>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 14 ++++----------
1 file 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 d8fd01fa617b..2b26024de888 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -3065,14 +3065,9 @@ void ice_ptp_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
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)
@@ -3315,10 +3310,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;
--
2.49.0
next reply other threads:[~2026-02-25 9:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 9:02 Natalia Wochtman [this message]
2026-02-25 10:44 ` [Intel-wired-lan] [PATCH iwl-next v1] ice: remove redundant checks from PTP init Paul Menzel
2026-04-01 16:53 ` Rinitha, SX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260225090236.187255-1-natalia.wochtman@intel.com \
--to=natalia.wochtman@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=grzegorz.nitka@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox