From c959e9d1dce63e849b2940fbc953835303f27ca1 Mon Sep 17 00:00:00 2001 From: Brad Griffis Date: Wed, 20 Aug 2025 00:01:44 +0000 Subject: [PATCH] coe: update for compilation against newer kernels The 'no_llseek' definition was removed in Linux v6.12. Use NV_NO_LLSEEK_PRESENT to check if it should be defined. The 'remove' callback of the 'platform_driver" structure was updated in Linux v6.11 to return void instead of int. Update rtcpu-coe.c so that it properly handles the above cases. Bug 5466808 Change-Id: I9306840f0b4a9e5a59a5c161ac3c58af2a70a4ed Signed-off-by: Brad Griffis Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3436078 Reviewed-by: Igor Mitsyanko Reviewed-by: svcacv GVS: buildbot_gerritrpt --- .../media/platform/tegra/camera/coe/rtcpu-coe.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c b/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c index c5e9b029..9704e451 100644 --- a/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c +++ b/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c @@ -1466,7 +1466,9 @@ static int coe_fop_channel_release( static const struct file_operations coe_channel_fops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = coe_fop_channel_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = coe_fop_channel_ioctl, @@ -1959,6 +1961,18 @@ static int camrtc_coe_remove(struct platform_device *pdev) return 0; } +#if defined(NV_PLATFORM_DRIVER_STRUCT_REMOVE_RETURNS_VOID) /* Linux v6.11 */ +static void camrtc_coe_remove_wrapper(struct platform_device *pdev) +{ + camrtc_coe_remove(pdev); +} +#else +static int camrtc_coe_remove_wrapper(struct platform_device *pdev) +{ + return camrtc_coe_remove(pdev); +} +#endif + static const struct of_device_id camrtc_coe_of_match[] = { { .compatible = "nvidia,tegra-camrtc-capture-coe" }, {}, @@ -1967,7 +1981,7 @@ MODULE_DEVICE_TABLE(of, camrtc_coe_of_match); static struct platform_driver capture_coe_driver = { .probe = camrtc_coe_probe, - .remove = camrtc_coe_remove, + .remove = camrtc_coe_remove_wrapper, .driver = { .name = "camrtc-coe", .owner = THIS_MODULE,