pps: generators: Use ktime_get_real_ts64() instead of ktime_get_snapshot()

There is no reason to use the more complex ktime_get_snapshot() for
retrieving CLOCK_REALTIME.

Just use ktime_get_real_ts64(), which avoids the extra timespec64
conversion as a bonus.

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Link: https://patch.msgid.link/20260529195557.074439049@kernel.org
This commit is contained in:
Thomas Gleixner 2026-05-29 21:59:59 +02:00
parent ef22786707
commit fe1159fe49
2 changed files with 2 additions and 10 deletions

View File

@ -39,11 +39,7 @@ static void pps_gen_ktimer_event(struct timer_list *unused)
static int pps_gen_dummy_get_time(struct pps_gen_device *pps_gen,
struct timespec64 *time)
{
struct system_time_snapshot snap;
ktime_get_snapshot(&snap);
*time = ktime_to_timespec64(snap.real);
ktime_get_real_ts64(time);
return 0;
}

View File

@ -189,11 +189,7 @@ static int pps_tio_gen_enable(struct pps_gen_device *pps_gen, bool enable)
static int pps_tio_get_time(struct pps_gen_device *pps_gen,
struct timespec64 *time)
{
struct system_time_snapshot snap;
ktime_get_snapshot(&snap);
*time = ktime_to_timespec64(snap.real);
ktime_get_real_ts64(time);
return 0;
}