ptp: lan743x: remove .adjfreq implementation
The lan743x driver implements both .adjfreq and .adjfine, but the core PTP subsystem prefers .adjfine if implemented. There is no reason to carry a .adjfreq implementation, so we can remove it. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Cc: Bryan Whitehead <bryan.whitehead@microchip.com> Cc: UNGLinuxDriver@microchip.com Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d8aad3f369
commit
c56dff6a9a
@ -365,40 +365,6 @@ static int lan743x_ptpci_adjfine(struct ptp_clock_info *ptpci, long scaled_ppm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lan743x_ptpci_adjfreq(struct ptp_clock_info *ptpci, s32 delta_ppb)
|
||||
{
|
||||
struct lan743x_ptp *ptp =
|
||||
container_of(ptpci, struct lan743x_ptp, ptp_clock_info);
|
||||
struct lan743x_adapter *adapter =
|
||||
container_of(ptp, struct lan743x_adapter, ptp);
|
||||
u32 lan743x_rate_adj = 0;
|
||||
bool positive = true;
|
||||
u32 u32_delta = 0;
|
||||
u64 u64_delta = 0;
|
||||
|
||||
if ((delta_ppb < (-LAN743X_PTP_MAX_FREQ_ADJ_IN_PPB)) ||
|
||||
delta_ppb > LAN743X_PTP_MAX_FREQ_ADJ_IN_PPB) {
|
||||
return -EINVAL;
|
||||
}
|
||||
if (delta_ppb > 0) {
|
||||
u32_delta = (u32)delta_ppb;
|
||||
positive = true;
|
||||
} else {
|
||||
u32_delta = (u32)(-delta_ppb);
|
||||
positive = false;
|
||||
}
|
||||
u64_delta = (((u64)u32_delta) << 35);
|
||||
lan743x_rate_adj = div_u64(u64_delta, 1000000000);
|
||||
|
||||
if (positive)
|
||||
lan743x_rate_adj |= PTP_CLOCK_RATE_ADJ_DIR_;
|
||||
|
||||
lan743x_csr_write(adapter, PTP_CLOCK_RATE_ADJ,
|
||||
lan743x_rate_adj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lan743x_ptpci_adjtime(struct ptp_clock_info *ptpci, s64 delta)
|
||||
{
|
||||
struct lan743x_ptp *ptp =
|
||||
@ -1583,7 +1549,6 @@ int lan743x_ptp_open(struct lan743x_adapter *adapter)
|
||||
ptp->ptp_clock_info.pps = LAN743X_PTP_N_PPS;
|
||||
ptp->ptp_clock_info.pin_config = ptp->pin_config;
|
||||
ptp->ptp_clock_info.adjfine = lan743x_ptpci_adjfine;
|
||||
ptp->ptp_clock_info.adjfreq = lan743x_ptpci_adjfreq;
|
||||
ptp->ptp_clock_info.adjtime = lan743x_ptpci_adjtime;
|
||||
ptp->ptp_clock_info.gettime64 = lan743x_ptpci_gettime64;
|
||||
ptp->ptp_clock_info.getcrosststamp = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user