]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
igb: use ktime_get_real helpers in igb_ptp_reset()
authorAleksandr Loktionov <aleksandr.loktionov@intel.com>
Tue, 9 Jun 2026 21:35:48 +0000 (14:35 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 23:44:05 +0000 (16:44 -0700)
Replace ktime_to_ns(ktime_get_real()) with the direct equivalent
ktime_get_real_ns() and ktime_to_timespec64(ktime_get_real()) with
ktime_get_real_ts64() in igb_ptp_reset().  Using the combined helpers
makes the intent clearer.

Suggested-by: Jacob Keller <jacob.e.keller@intel.com>
Suggested-by: Simon Horman <horms@kernel.org>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20260609213559.178657-8-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/igb/igb_ptp.c

index bd85d02ecadd86602e1e3ebf5c54a271602dd77d..638d8242b66bba6163d2c33a9c45245797e4a11a 100644 (file)
@@ -1500,12 +1500,13 @@ void igb_ptp_reset(struct igb_adapter *adapter)
 
        /* Re-initialize the timer. */
        if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
-               struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
+               struct timespec64 ts;
 
+               ktime_get_real_ts64(&ts);
                igb_ptp_write_i210(adapter, &ts);
        } else {
                timecounter_init(&adapter->tc, &adapter->cc,
-                                ktime_to_ns(ktime_get_real()));
+                                ktime_get_real_ns());
        }
 out:
        spin_unlock_irqrestore(&adapter->tmreg_lock, flags);