Message ID | 20230515114721.6420-1-csokas.bence@prolan.hu (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: fec: Refactor: rename `adapter` to `fep` | expand |
On 15.05.2023 13:47:21, Csókás Bence wrote: > Commit 01b825f reverted a style fix, which renamed > `struct fec_enet_private *adapter` to `fep` to match > the rest of the driver. That description is a bit misleading. In fact commit 01b825f997ac ("Revert "net: fec: Use a spinlock to guard `fep->ptp_clk_on`"") reverted a patch that introduced a regression. As a side effect the problematic patch b353b241f1eb ("net: fec: Use a spinlock to guard `fep->ptp_clk_on`") renamed struct fec_enet_private *adapter to fep to match the rest of the driver. > This commit factors out > that style fix. > > Signed-off-by: Csókás Bence <csokas.bence@prolan.hu> Marc
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index ab86bb8562ef..afc658d2c271 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -443,21 +443,21 @@ static int fec_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) */ static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) { - struct fec_enet_private *adapter = + struct fec_enet_private *fep = container_of(ptp, struct fec_enet_private, ptp_caps); u64 ns; unsigned long flags; - mutex_lock(&adapter->ptp_clk_mutex); + mutex_lock(&fep->ptp_clk_mutex); /* Check the ptp clock */ - if (!adapter->ptp_clk_on) { - mutex_unlock(&adapter->ptp_clk_mutex); + if (!fep->ptp_clk_on) { + mutex_unlock(&fep->ptp_clk_mutex); return -EINVAL; } - spin_lock_irqsave(&adapter->tmreg_lock, flags); - ns = timecounter_read(&adapter->tc); - spin_unlock_irqrestore(&adapter->tmreg_lock, flags); - mutex_unlock(&adapter->ptp_clk_mutex); + spin_lock_irqsave(&fep->tmreg_lock, flags); + ns = timecounter_read(&fep->tc); + spin_unlock_irqrestore(&fep->tmreg_lock, flags); + mutex_unlock(&fep->ptp_clk_mutex); *ts = ns_to_timespec64(ns);
Commit 01b825f reverted a style fix, which renamed `struct fec_enet_private *adapter` to `fep` to match the rest of the driver. This commit factors out that style fix. Signed-off-by: Csókás Bence <csokas.bence@prolan.hu> --- drivers/net/ethernet/freescale/fec_ptp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)