From 57bb1ee6034046be70aed33fd6d447bb2b7261fa Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 4 Nov 2020 11:04:21 +0100 Subject: drm: Compile out legacy chunks from struct drm_device This means some very few #ifdef in code, but it allows us to enlist the compiler to make sure this stuff isn't used anymore. More important, only legacy drivers change drm_device (for the legacy_dev_list shadow attach management), therefore this is prep to allow modern drivers to have a const driver struct. Which is nice, because there's a ton of function pointers in there. Acked-by: Maxime Ripard Reviewed-by: Sam Ravnborg Review-by: Thomas Zimmermann Reviewed-by: Alex Deucher Signed-off-by: Daniel Vetter Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20201104100425.1922351-2-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_file.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/drm/drm_file.c') diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 0ac4566ae3f4..b50380fa80ce 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -258,9 +258,11 @@ void drm_file_free(struct drm_file *file) (long)old_encode_dev(file->minor->kdev->devt), atomic_read(&dev->open_count)); +#ifdef CONFIG_DRM_LEGACY if (drm_core_check_feature(dev, DRIVER_LEGACY) && dev->driver->preclose) dev->driver->preclose(dev, file); +#endif if (drm_core_check_feature(dev, DRIVER_LEGACY)) drm_legacy_lock_release(dev, file->filp); -- cgit v1.2.3