diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-12-03 11:03:56 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-12-05 08:44:04 +0100 |
commit | 1be9d5f069964108125592af92304da76c5865bf (patch) | |
tree | d963d48e2e4cc9244d823b1a18e708349dbc6f6b /include/drm/drm_legacy.h | |
parent | drm/pci: Only build drm_pci.c if CONFIG_PCI is set (diff) | |
download | linux-1be9d5f069964108125592af92304da76c5865bf.tar.xz linux-1be9d5f069964108125592af92304da76c5865bf.zip |
drm/pci: Hide legacy PCI functions from non-legacy code
Declarations of drm_legacy_pci_{init,exit}() are being moved to
drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-3-tzimmermann@suse.de
Diffstat (limited to 'include/drm/drm_legacy.h')
-rw-r--r-- | include/drm/drm_legacy.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h index 58dc0c04bf99..5745710453c8 100644 --- a/include/drm/drm_legacy.h +++ b/include/drm/drm_legacy.h @@ -38,7 +38,9 @@ #include <drm/drm_hashtab.h> struct drm_device; +struct drm_driver; struct file; +struct pci_driver; /* * Legacy Support for palateontologic DRM drivers @@ -188,8 +190,33 @@ do { \ void drm_legacy_idlelock_take(struct drm_lock_data *lock); void drm_legacy_idlelock_release(struct drm_lock_data *lock); -/* drm_pci.c dma alloc wrappers */ +/* drm_pci.c */ + +#ifdef CONFIG_PCI + void __drm_legacy_pci_free(struct drm_device *dev, drm_dma_handle_t * 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); + +#else + +static inline void __drm_legacy_pci_free(struct drm_device *dev, + drm_dma_handle_t *dmah) +{ +} + +static inline int drm_legacy_pci_init(struct drm_driver *driver, + struct pci_driver *pdriver) +{ + return -EINVAL; +} + +static inline void drm_legacy_pci_exit(struct drm_driver *driver, + struct pci_driver *pdriver) +{ +} + +#endif /* drm_memory.c */ void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev); |