diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index cf241dd3..71cd3357 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -930,7 +930,9 @@ static const struct drm_driver tegra_drm_driver = { .name = DRIVER_NAME, .desc = DRIVER_DESC, +#if defined(NV_DRM_DRIVER_STRUCT_HAS_DATE) /* Linux v6.14 */ .date = DRIVER_DATE, +#endif .major = DRIVER_MAJOR, .minor = DRIVER_MINOR, .patchlevel = DRIVER_PATCHLEVEL, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 21e69a4c..045cb451 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -119,6 +119,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += disk_check_media_change NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_slave_config_struct_has_slave_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_framebuffers NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_debugfs_remove_files_has_root_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_driver_struct_has_date NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_driver_struct_has_irq_enabled_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_alloc_info NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_prepare_has_preferred_bpp_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 53273e3b..0fb09a6d 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7097,6 +7097,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_DRM_DEBUGFS_REMOVE_FILES_HAS_ROOT_ARG" "" "types" ;; + drm_driver_struct_has_date) + # + # Determine if the 'drm_driver' structure has a 'date' field. + # + # Commit cb2e1c2136f7 ("drm: remove driver date from struct drm_driver and all + # drivers") removed the 'date' field from the 'drm_driver' structure in Linux + # v6.14. + # + CODE=" + #include + int conftest_drm_driver_struct_has_date(void) { + return offsetof(struct drm_driver, date); + }" + + compile_check_conftest "$CODE" "NV_DRM_DRIVER_STRUCT_HAS_DATE" "" "types" + ;; + drm_driver_struct_has_irq_enabled_arg) # # Determine if the 'drm_driver' structure