mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was updated to return void instead of 'int'. Update all the impacted drivers as necessary to fix this. Bug 4749580 Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878 Reviewed-by: Brad Griffis <bgriffis@nvidia.com> Tested-by: Brad Griffis <bgriffis@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
e7b93be004
commit
951b2423a8
@@ -1,11 +1,13 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* PCIe driver to enumerate PCIe virtual functions in VM.
|
||||
*
|
||||
* Copyright (C) 2021-2022, NVIDIA Corporation. All rights reserved.
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
@@ -142,13 +144,25 @@ static const struct of_device_id pci_tegra_vf_of_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, pci_tegra_vf_of_match);
|
||||
|
||||
#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */
|
||||
static inline void pci_tegra_vf_remove_wrapper(struct platform_device *pdev)
|
||||
{
|
||||
pci_tegra_vf_remove(pdev);
|
||||
}
|
||||
#else
|
||||
static inline int pci_tegra_vf_remove_wrapper(struct platform_device *pdev)
|
||||
{
|
||||
return pci_tegra_vf_remove(pdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct platform_driver pci_tegra_vf_driver = {
|
||||
.driver = {
|
||||
.name = "pcie-tegra-vf",
|
||||
.of_match_table = pci_tegra_vf_of_match,
|
||||
},
|
||||
.probe = pci_tegra_vf_probe,
|
||||
.remove = pci_tegra_vf_remove,
|
||||
.remove = pci_tegra_vf_remove_wrapper,
|
||||
};
|
||||
module_platform_driver(pci_tegra_vf_driver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user