Skip to content

Commit bf8ca67

Browse files
dolciniPaolo Abeni
authored andcommitted
net: fec: refactor PPS channel configuration
Preparation patch to allow for PPS channel configuration, no functional change intended. Signed-off-by: Francesco Dolcini <[email protected]> Reviewed-by: Frank Li <[email protected]> Reviewed-by: Csókás, Bence <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 1aa772b commit bf8ca67

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
#define FEC_CC_MULT (1 << 31)
8585
#define FEC_COUNTER_PERIOD (1 << 31)
8686
#define PPS_OUPUT_RELOAD_PERIOD NSEC_PER_SEC
87-
#define FEC_CHANNLE_0 0
88-
#define DEFAULT_PPS_CHANNEL FEC_CHANNLE_0
87+
#define DEFAULT_PPS_CHANNEL 0
8988

9089
#define FEC_PTP_MAX_NSEC_PERIOD 4000000000ULL
9190
#define FEC_PTP_MAX_NSEC_COUNTER 0x80000000ULL
@@ -524,8 +523,9 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
524523
unsigned long flags;
525524
int ret = 0;
526525

526+
fep->pps_channel = DEFAULT_PPS_CHANNEL;
527+
527528
if (rq->type == PTP_CLK_REQ_PPS) {
528-
fep->pps_channel = DEFAULT_PPS_CHANNEL;
529529
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
530530

531531
ret = fec_ptp_enable_pps(fep, on);
@@ -536,10 +536,9 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
536536
if (rq->perout.flags)
537537
return -EOPNOTSUPP;
538538

539-
if (rq->perout.index != DEFAULT_PPS_CHANNEL)
539+
if (rq->perout.index != fep->pps_channel)
540540
return -EOPNOTSUPP;
541541

542-
fep->pps_channel = DEFAULT_PPS_CHANNEL;
543542
period.tv_sec = rq->perout.period.sec;
544543
period.tv_nsec = rq->perout.period.nsec;
545544
period_ns = timespec64_to_ns(&period);

0 commit comments

Comments
 (0)