summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_device.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-11-04 11:04:23 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-11-06 10:31:26 +0100
commit8f5c7aa078cf6f81ef5afc3f0516b4049decb4eb (patch)
treefb32adcbc4ed9e4354142586b53d73356dd9c65f /include/drm/drm_device.h
parente431eb8089eef1477082d6ae072ac252699b231f (diff)
downloadlinux-8f5c7aa078cf6f81ef5afc3f0516b4049decb4eb.tar.gz
linux-8f5c7aa078cf6f81ef5afc3f0516b4049decb4eb.tar.xz
drm: Allow const struct drm_driver
It's nice if a big function/ioctl table like this is const. Only downside here is that we need a few more #ifdef to paper over the differences when CONFIG_DRM_LEGACY is enabled. Maybe provides more motivation to sunset that horror show :-) v2: - Fix super important checkpatch warning (Sam) - Update the kerneldoc example too (Sam) Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201104100425.1922351-4-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm/drm_device.h')
-rw-r--r--include/drm/drm_device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index f4f68e7a9149..2c361964aee7 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -83,7 +83,11 @@ struct drm_device {
} managed;
/** @driver: DRM driver managing the device */
+#ifdef CONFIG_DRM_LEGACY
struct drm_driver *driver;
+#else
+ const struct drm_driver *driver;
+#endif
/**
* @dev_private: