Skip to content

Commit

Permalink
Merge branch 'net-fec-a-few-improvements'
Browse files Browse the repository at this point in the history
Sergey Organov says:

====================
net: fec: a few improvements

This is a collection of simple improvements that reduce and/or
simplify code. They got developed out of attempt to use DP83640 PTP
PHY connected to built-in FEC (that has its own PTP support) of the
iMX 6SX micro-controller. The primary bug-fix was now submitted
separately, and this is the rest of the changes.

NOTE: the patches are developed and tested on 4.9.146, and rebased on
top of recent 'net-next/master', where, besides visual inspection, I
only tested that they do compile.
====================

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jul 16, 2020
2 parents 59632b2 + 31bb1a5 commit 999cf8a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/net/ethernet/freescale/fec_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
u64 ns;
val = 0;

if (!(fep->hwts_tx_en || fep->hwts_rx_en)) {
dev_err(&fep->pdev->dev, "No ptp stack is running\n");
return -EINVAL;
}

if (fep->pps_enable == enable)
return 0;

Expand Down Expand Up @@ -269,7 +264,7 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev)
fep->cc.mult = FEC_CC_MULT;

/* reset the ns time counter */
timecounter_init(&fep->tc, &fep->cc, ktime_to_ns(ktime_get_real()));
timecounter_init(&fep->tc, &fep->cc, 0);

spin_unlock_irqrestore(&fep->tmreg_lock, flags);
}
Expand Down Expand Up @@ -478,9 +473,7 @@ int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)

switch (config.rx_filter) {
case HWTSTAMP_FILTER_NONE:
if (fep->hwts_rx_en)
fep->hwts_rx_en = 0;
config.rx_filter = HWTSTAMP_FILTER_NONE;
fep->hwts_rx_en = 0;
break;

default:
Expand Down Expand Up @@ -577,7 +570,7 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
int ret;

fep->ptp_caps.owner = THIS_MODULE;
snprintf(fep->ptp_caps.name, 16, "fec ptp");
strlcpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));

fep->ptp_caps.max_adj = 250000000;
fep->ptp_caps.n_alarm = 0;
Expand Down

0 comments on commit 999cf8a

Please sign in to comment.