mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: 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 NVGPU driver as necessary to fix this. Bug 4749580 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Change-Id: I37f30bb7a23cc0ee413cf3db7a19816b51228818 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3183046 (cherry picked from commit 099cff3f1b21b9c51e88438dbca1bbda2668727c) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3185777 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Sagar Kamble <skamble@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
10b813a25d
commit
e2d19ad097
@@ -1,10 +1,14 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2011-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2011-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
/*
|
||||
* GK20A Graphics
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NVIDIA_CONFTEST)
|
||||
#include <nvidia/conftest.h>
|
||||
#endif
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
@@ -2073,9 +2077,21 @@ static int __exit gk20a_remove(struct platform_device *pdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */
|
||||
static inline void __exit gk20a_remove_wrapper(struct platform_device *pdev)
|
||||
{
|
||||
gk20a_remove(pdev);
|
||||
}
|
||||
#else
|
||||
static inline int __exit gk20a_remove_wrapper(struct platform_device *pdev)
|
||||
{
|
||||
return gk20a_remove(pdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct platform_driver gk20a_driver = {
|
||||
.probe = gk20a_probe,
|
||||
.remove = __exit_p(gk20a_remove),
|
||||
.remove = __exit_p(gk20a_remove_wrapper),
|
||||
.shutdown = gk20a_pm_shutdown,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
|
||||
Reference in New Issue
Block a user