aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/drm/drm_legacy.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2020-02-21 00:19:22 +0200
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2021-01-05 07:20:35 +0200
commitb1dda997a8a98fcb98189e5f4ee3108bc3da3d21 (patch)
tree3bfa36905d3e1c1a8f6b909fe8bcb726fe8da2ce /include/drm/drm_legacy.h
parentdrm: Move legacy device list out of drm_driver (diff)
downloadwireguard-linux-b1dda997a8a98fcb98189e5f4ee3108bc3da3d21.tar.xz
wireguard-linux-b1dda997a8a98fcb98189e5f4ee3108bc3da3d21.zip
drm: Use a const drm_driver for legacy PCI devices
Now that the legacy PCI support code doesn't need to write to the drm_driver structure, it can be treated as const through the whole DRM core, unconditionally. This allows declaring the structure as const in all drivers, removing one possible attack vector. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_legacy.h')
-rw-r--r--include/drm/drm_legacy.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
index 852d7451eeb1..8ed04e9be997 100644
--- a/include/drm/drm_legacy.h
+++ b/include/drm/drm_legacy.h
@@ -198,8 +198,10 @@ struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
size_t align);
void drm_pci_free(struct drm_device *dev, struct drm_dma_handle *dmah);
-int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
-void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
+int drm_legacy_pci_init(const struct drm_driver *driver,
+ struct pci_driver *pdriver);
+void drm_legacy_pci_exit(const struct drm_driver *driver,
+ struct pci_driver *pdriver);
#else
@@ -214,13 +216,13 @@ static inline void drm_pci_free(struct drm_device *dev,
{
}
-static inline int drm_legacy_pci_init(struct drm_driver *driver,
+static inline int drm_legacy_pci_init(const struct drm_driver *driver,
struct pci_driver *pdriver)
{
return -EINVAL;
}
-static inline void drm_legacy_pci_exit(struct drm_driver *driver,
+static inline void drm_legacy_pci_exit(const struct drm_driver *driver,
struct pci_driver *pdriver)
{
}