Skip to content

Commit 2211881

Browse files
michichanguy11
authored andcommitted
ice: fold ice_ptp_read_time into ice_ptp_gettimex64
This is a cleanup. It is unnecessary to have this function just to call another function. Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Michal Schmidt <[email protected]> Reviewed-by: Sai Krishna <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent d29a813 commit 2211881

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,26 +1166,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)
11661166
ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx);
11671167
}
11681168

1169-
/**
1170-
* ice_ptp_read_time - Read the time from the device
1171-
* @pf: Board private structure
1172-
* @ts: timespec structure to hold the current time value
1173-
* @sts: Optional parameter for holding a pair of system timestamps from
1174-
* the system clock. Will be ignored if NULL is given.
1175-
*
1176-
* This function reads the source clock registers and stores them in a timespec.
1177-
* However, since the registers are 64 bits of nanoseconds, we must convert the
1178-
* result to a timespec before we can return.
1179-
*/
1180-
static void
1181-
ice_ptp_read_time(struct ice_pf *pf, struct timespec64 *ts,
1182-
struct ptp_system_timestamp *sts)
1183-
{
1184-
u64 time_ns = ice_ptp_read_src_clk_reg(pf, sts);
1185-
1186-
*ts = ns_to_timespec64(time_ns);
1187-
}
1188-
11891169
/**
11901170
* ice_ptp_write_init - Set PHC time to provided value
11911171
* @pf: Board private structure
@@ -1926,9 +1906,10 @@ ice_ptp_gettimex64(struct ptp_clock_info *info, struct timespec64 *ts,
19261906
struct ptp_system_timestamp *sts)
19271907
{
19281908
struct ice_pf *pf = ptp_info_to_pf(info);
1909+
u64 time_ns;
19291910

1930-
ice_ptp_read_time(pf, ts, sts);
1931-
1911+
time_ns = ice_ptp_read_src_clk_reg(pf, sts);
1912+
*ts = ns_to_timespec64(time_ns);
19321913
return 0;
19331914
}
19341915

0 commit comments

Comments
 (0)