Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 286af315 authored by Kefeng Wang's avatar Kefeng Wang Committed by David S. Miller
Browse files

net: cavium: liquidio: use helpers ns_to_timespec64()



Convert the driver to use ns_to_timespec64() to keep consistency
with timespec64_to_ns() instead of open coding the same logic.

Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63e51b6a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1526,7 +1526,6 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp,
				struct timespec64 *ts)
{
	u64 ns;
	u32 remainder;
	unsigned long flags;
	struct lio *lio = container_of(ptp, struct lio, ptp_info);
	struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;
@@ -1536,8 +1535,7 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp,
	ns += lio->ptp_adjust;
	spin_unlock_irqrestore(&lio->ptp_lock, flags);

	ts->tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder);
	ts->tv_nsec = remainder;
	*ts = ns_to_timespec64(ns);

	return 0;
}