mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 01:31:30 +03:00
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 <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3128119
(cherry picked from commit 46af0c1d24)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129149
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b0e75c8874
commit
e9b64b08d1
@@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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 <linux/version.h>
|
|
||||||
#include "ether_linux.h"
|
#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 0 on success
|
||||||
* @retval "negative value" on failure.
|
* @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)
|
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 *pdata = container_of(ptp,
|
||||||
struct ether_priv_data,
|
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 = {};
|
struct osi_ioctl ioctl_data = {};
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret = -1;
|
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);
|
raw_spin_lock_irqsave(&pdata->ptp_lock, flags);
|
||||||
|
|
||||||
ioctl_data.cmd = OSI_CMD_ADJ_FREQ;
|
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);
|
ret = osi_handle_ioctl(osi_core, &ioctl_data);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(pdata->dev,
|
dev_err(pdata->dev,
|
||||||
@@ -253,11 +245,7 @@ static struct ptp_clock_info ether_ptp_clock_ops = {
|
|||||||
.n_ext_ts = 0,
|
.n_ext_ts = 0,
|
||||||
.n_per_out = 0,
|
.n_per_out = 0,
|
||||||
.pps = 0,
|
.pps = 0,
|
||||||
#if KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE
|
|
||||||
.adjfreq = ether_adjust_clock,
|
|
||||||
#else
|
|
||||||
.adjfine = ether_adjust_clock,
|
.adjfine = ether_adjust_clock,
|
||||||
#endif
|
|
||||||
.adjtime = ether_adjust_time,
|
.adjtime = ether_adjust_time,
|
||||||
.gettime64 = ether_get_time,
|
.gettime64 = ether_get_time,
|
||||||
.settime64 = ether_set_time,
|
.settime64 = ether_set_time,
|
||||||
|
|||||||
Reference in New Issue
Block a user