Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'net-fec-a-few-improvements'

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>

+3 -10
+3 -10
drivers/net/ethernet/freescale/fec_ptp.c
··· 103 103 u64 ns; 104 104 val = 0; 105 105 106 - if (!(fep->hwts_tx_en || fep->hwts_rx_en)) { 107 - dev_err(&fep->pdev->dev, "No ptp stack is running\n"); 108 - return -EINVAL; 109 - } 110 - 111 106 if (fep->pps_enable == enable) 112 107 return 0; 113 108 ··· 264 269 fep->cc.mult = FEC_CC_MULT; 265 270 266 271 /* reset the ns time counter */ 267 - timecounter_init(&fep->tc, &fep->cc, ktime_to_ns(ktime_get_real())); 272 + timecounter_init(&fep->tc, &fep->cc, 0); 268 273 269 274 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 270 275 } ··· 473 478 474 479 switch (config.rx_filter) { 475 480 case HWTSTAMP_FILTER_NONE: 476 - if (fep->hwts_rx_en) 477 - fep->hwts_rx_en = 0; 478 - config.rx_filter = HWTSTAMP_FILTER_NONE; 481 + fep->hwts_rx_en = 0; 479 482 break; 480 483 481 484 default: ··· 570 577 int ret; 571 578 572 579 fep->ptp_caps.owner = THIS_MODULE; 573 - snprintf(fep->ptp_caps.name, 16, "fec ptp"); 580 + strlcpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name)); 574 581 575 582 fep->ptp_caps.max_adj = 250000000; 576 583 fep->ptp_caps.n_alarm = 0;