drivers: Update timer APIs for Linux v6.15

In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
(cherry picked from commit ce90abdb8137610988f291cd02ed8cf97bca673f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499760
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
Jon Hunter
2025-04-08 13:30:51 +01:00
committed by mobile promotions
parent 48373c24ad
commit 2ec6cdcc9b
10 changed files with 95 additions and 4 deletions

View File

@@ -1933,7 +1933,11 @@ static int mttcan_remove(struct platform_device *pdev)
dev_info(&dev->dev, "%s\n", __func__);
#if defined(NV_TIMER_DELETE_PRESENT) /* Linux v6.15 */
timer_delete_sync(&priv->timer);
#else
del_timer_sync(&priv->timer);
#endif
mttcan_delete_sys_files(&dev->dev);
unregister_mttcan_dev(dev);
mttcan_unprepare_clock(priv);