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: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
63e51b6a24
commit
286af315d3
1 changed files with 1 additions and 3 deletions
|
@ -1526,7 +1526,6 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp,
|
||||||
struct timespec64 *ts)
|
struct timespec64 *ts)
|
||||||
{
|
{
|
||||||
u64 ns;
|
u64 ns;
|
||||||
u32 remainder;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct lio *lio = container_of(ptp, struct lio, ptp_info);
|
struct lio *lio = container_of(ptp, struct lio, ptp_info);
|
||||||
struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;
|
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;
|
ns += lio->ptp_adjust;
|
||||||
spin_unlock_irqrestore(&lio->ptp_lock, flags);
|
spin_unlock_irqrestore(&lio->ptp_lock, flags);
|
||||||
|
|
||||||
ts->tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder);
|
*ts = ns_to_timespec64(ns);
|
||||||
ts->tv_nsec = remainder;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue