Commit 1be9d5f0 authored by Thomas Zimmermann's avatar Thomas Zimmermann

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-3-tzimmermann@suse.de
parent 5c7a0bb0
...@@ -282,6 +282,8 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, ...@@ -282,6 +282,8 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
} }
EXPORT_SYMBOL(drm_get_pci_dev); EXPORT_SYMBOL(drm_get_pci_dev);
#ifdef CONFIG_DRM_LEGACY
/** /**
* drm_legacy_pci_init - shadow-attach a legacy DRM PCI driver * drm_legacy_pci_init - shadow-attach a legacy DRM PCI driver
* @driver: DRM device driver * @driver: DRM device driver
...@@ -354,3 +356,5 @@ void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) ...@@ -354,3 +356,5 @@ void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
DRM_INFO("Module unloaded\n"); DRM_INFO("Module unloaded\n");
} }
EXPORT_SYMBOL(drm_legacy_pci_exit); EXPORT_SYMBOL(drm_legacy_pci_exit);
#endif
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
#include <drm/drm_hashtab.h> #include <drm/drm_hashtab.h>
struct drm_device; struct drm_device;
struct drm_driver;
struct file; struct file;
struct pci_driver;
/* /*
* Legacy Support for palateontologic DRM drivers * Legacy Support for palateontologic DRM drivers
...@@ -188,8 +190,33 @@ do { \ ...@@ -188,8 +190,33 @@ do { \
void drm_legacy_idlelock_take(struct drm_lock_data *lock); void drm_legacy_idlelock_take(struct drm_lock_data *lock);
void drm_legacy_idlelock_release(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); 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 */ /* drm_memory.c */
void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev); void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev);
......
...@@ -38,7 +38,6 @@ struct drm_dma_handle; ...@@ -38,7 +38,6 @@ struct drm_dma_handle;
struct drm_device; struct drm_device;
struct drm_driver; struct drm_driver;
struct drm_master; struct drm_master;
struct pci_device;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -50,9 +49,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, ...@@ -50,9 +49,6 @@ int drm_get_pci_dev(struct pci_dev *pdev,
const struct pci_device_id *ent, const struct pci_device_id *ent,
struct drm_driver *driver); struct drm_driver *driver);
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 #else
static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev,
...@@ -73,17 +69,6 @@ static inline int drm_get_pci_dev(struct pci_dev *pdev, ...@@ -73,17 +69,6 @@ static inline int drm_get_pci_dev(struct pci_dev *pdev,
return -ENOSYS; return -ENOSYS;
} }
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 #endif
#endif /* _DRM_PCI_H_ */ #endif /* _DRM_PCI_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment