From e9b64b08d15dabcc0de1c13f08742e46ff6a756b Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 29 Apr 2024 10:37:07 +0100 Subject: [PATCH] net: nvethernet: Drop adjfreq support The 'adjfine' method was first introduced in Linux v4.10 by commit d8d263541913 ("ptp: Introduce a high resolution frequency adjustment method.") and the 'adjfreq' method was finally removed in Linux v6.2. Given that 'adjfine' has been supported since Linux v4.10, drop the deprecated 'adjfreq' method completely to simplify the nvethernet driver. This fixes build issues for 3rd party kernels that removed the 'adjfreq' method and are older than Linux v6.2. Bug 3936429 Change-Id: I897bbd3ba92b11d8132c5762d2618b4e82ad44aa Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3128119 (cherry picked from commit 46af0c1d24d78b3b350413510809ffdd241983c7) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129149 Reviewed-by: Brad Griffis GVS: Gerrit_Virtual_Submit --- drivers/net/ethernet/nvidia/nvethernet/ptp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ptp.c b/drivers/net/ethernet/nvidia/nvethernet/ptp.c index 0472350c..dfa4c368 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ptp.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ptp.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2019-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved */ +// SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -#include #include "ether_linux.h" /** @@ -130,11 +129,7 @@ static int ether_adjust_time(struct ptp_clock_info *ptp, s64 nsec_delta) * @retval 0 on success * @retval "negative value" on failure. */ -#if KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE -static int ether_adjust_clock(struct ptp_clock_info *ptp, s32 ppb) -#else static int ether_adjust_clock(struct ptp_clock_info *ptp, long scaled_ppm) -#endif { struct ether_priv_data *pdata = container_of(ptp, struct ether_priv_data, @@ -143,14 +138,11 @@ static int ether_adjust_clock(struct ptp_clock_info *ptp, long scaled_ppm) struct osi_ioctl ioctl_data = {}; unsigned long flags; int ret = -1; -#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE - s32 ppb = scaled_ppm_to_ppb(scaled_ppm); -#endif raw_spin_lock_irqsave(&pdata->ptp_lock, flags); ioctl_data.cmd = OSI_CMD_ADJ_FREQ; - ioctl_data.arg6_32 = ppb; + ioctl_data.arg6_32 = scaled_ppm_to_ppb(scaled_ppm); ret = osi_handle_ioctl(osi_core, &ioctl_data); if (ret < 0) { dev_err(pdata->dev, @@ -253,11 +245,7 @@ static struct ptp_clock_info ether_ptp_clock_ops = { .n_ext_ts = 0, .n_per_out = 0, .pps = 0, -#if KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE - .adjfreq = ether_adjust_clock, -#else .adjfine = ether_adjust_clock, -#endif .adjtime = ether_adjust_time, .gettime64 = ether_get_time, .settime64 = ether_set_time,