]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: Don't modify the global ptp ops directly
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Tue, 12 Nov 2024 17:06:49 +0000 (18:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Nov 2024 02:52:12 +0000 (18:52 -0800)
commit80dc1ff787a9f9d124445574bc40f45849ba7f41
treebe2850b629f6d46f1c81a147924563f6ecb6da79
parent3bf8163a36adb550536c0de8ae00685f050edf53
net: stmmac: Don't modify the global ptp ops directly

The stmmac_ptp_clock_ops are copied into the stmmac_priv structure
before being registered to the PTP core. Some adjustments are made prior
to that, such as the number of snapshots or max adjustment parameters.

Instead of modifying the global definition, then copying into the local
private data, let's first copy then modify the local parameters.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20241112170658.2388529-2-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c