PCI: tegra264: Fix build for Linux v6.11

In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update the Tegra264 PCI drivers
as necessary to ensure that they can be built for Linux v6.11+ kernels.

Bug 4749580
Bug 4911768

Change-Id: I9081f7cb61e9020ec8c1462a3c1b21118d7025bc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233981
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2024-10-21 13:13:16 +01:00
parent f01227d4ea
commit 87799bf046
2 changed files with 32 additions and 8 deletions

View File

@@ -1,9 +1,8 @@
// SPDX-License-Identifier: GPL-2.0+ // SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
/* /*
* PCIe EP controller driver for Tegra264 SoC * PCIe EP controller driver for Tegra264 SoC
* *
* Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
*
* Author: Manikanta Maddireddy <mmaddireddy@nvidia.com> * Author: Manikanta Maddireddy <mmaddireddy@nvidia.com>
*/ */
@@ -802,9 +801,21 @@ static const struct dev_pm_ops tegra264_pcie_ep_dev_pm_ops = {
}; };
#endif #endif
#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */
static void tegra264_pcie_ep_remove_wrapper(struct platform_device *pdev)
{
tegra264_pcie_ep_remove(pdev);
}
#else
static int tegra264_pcie_ep_remove_wrapper(struct platform_device *pdev)
{
return tegra264_pcie_ep_remove(pdev);
}
#endif
static struct platform_driver tegra264_pcie_ep_driver = { static struct platform_driver tegra264_pcie_ep_driver = {
.probe = tegra264_pcie_ep_probe, .probe = tegra264_pcie_ep_probe,
.remove = tegra264_pcie_ep_remove, .remove = tegra264_pcie_ep_remove_wrapper,
.driver = { .driver = {
.name = "tegra264-pcie-ep", .name = "tegra264-pcie-ep",
.of_match_table = tegra264_pcie_ep_of_match, .of_match_table = tegra264_pcie_ep_of_match,

View File

@@ -1,12 +1,13 @@
// SPDX-License-Identifier: GPL-2.0+ // SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
/* /*
* PCIe host controller driver for Tegra264 SoC * PCIe host controller driver for Tegra264 SoC
* *
* Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
*
* Author: Manikanta Maddireddy <mmaddireddy@nvidia.com> * Author: Manikanta Maddireddy <mmaddireddy@nvidia.com>
*/ */
#include <nvidia/conftest.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
@@ -324,9 +325,21 @@ static const struct of_device_id tegra264_pcie_of_match[] = {
{}, {},
}; };
#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */
static void tegra264_pcie_remove_wrapper(struct platform_device *pdev)
{
tegra264_pcie_remove(pdev);
}
#else
static int tegra264_pcie_remove_wrapper(struct platform_device *pdev)
{
return tegra264_pcie_remove(pdev);
}
#endif
static struct platform_driver tegra264_pcie_driver = { static struct platform_driver tegra264_pcie_driver = {
.probe = tegra264_pcie_probe, .probe = tegra264_pcie_probe,
.remove = tegra264_pcie_remove, .remove = tegra264_pcie_remove_wrapper,
.driver = { .driver = {
.name = "tegra264-pcie", .name = "tegra264-pcie",
.pm = &tegra264_pcie_pm_ops, .pm = &tegra264_pcie_pm_ops,