From 33ffbe3ff29c3de28ae8fff0d4a7833aaee239af Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 27 Aug 2024 13:19:10 +0100 Subject: [PATCH] gpu: host1x-emu: 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 host1x-emu drivers as necessary to fix this. Bug 4749580 Change-Id: I9b4bddd4ae57087c34ce34cea7e8b54b14d4793c Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3202780 GVS: buildbot_gerritrpt Reviewed-by: Laxman Dewangan --- drivers/gpu/host1x-emu/dev.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/host1x-emu/dev.c b/drivers/gpu/host1x-emu/dev.c index dd1c1eb6..cceabfd3 100644 --- a/drivers/gpu/host1x-emu/dev.c +++ b/drivers/gpu/host1x-emu/dev.c @@ -348,6 +348,18 @@ static const struct dev_pm_ops host1x_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(host1x_runtime_suspend, host1x_runtime_resume) }; +#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */ +static inline void host1x_remove_wrapper(struct platform_device *pdev) +{ + host1x_remove(pdev); +} +#else +static inline int host1x_remove_wrapper(struct platform_device *pdev) +{ + return host1x_remove(pdev); +} +#endif + static struct platform_driver tegra_host1x_driver = { .driver = { .name = "tegra-host1x-emu", @@ -355,7 +367,7 @@ static struct platform_driver tegra_host1x_driver = { .pm = &host1x_pm_ops, }, .probe = host1x_probe, - .remove = host1x_remove, + .remove = host1x_remove_wrapper, }; static struct platform_driver * const drivers[] = {