drm: Implement drm_get_pci_dev() dummy for !PCI
authorThierry Reding <treding@nvidia.com>
Tue, 5 Aug 2014 11:37:47 +0000 (13:37 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 13 Nov 2014 09:43:50 +0000 (10:43 +0100)
Implementing a dummy of this function allows drivers that use it to be
built on platforms that don't have PCI. This can happen for example if
the nouveau driver is built on Tegra without PCI enabled (or on 64-bit
ARM where PCI is not yet implemented).

Signed-off-by: Thierry Reding <treding@nvidia.com>
include/drm/drmP.h

index 75b259492a8d5b6e30586f32e4a34d32a7c6ef35..87aac391c6056668e96005431886abc7a47d7f03 100644 (file)
@@ -1028,10 +1028,25 @@ void drm_pci_agp_destroy(struct drm_device *dev);
 
 extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
 extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
+#ifdef CONFIG_PCI
 extern int drm_get_pci_dev(struct pci_dev *pdev,
                           const struct pci_device_id *ent,
                           struct drm_driver *driver);
 extern int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
+#else
+static inline int drm_get_pci_dev(struct pci_dev *pdev,
+                                 const struct pci_device_id *ent,
+                                 struct drm_driver *driver)
+{
+       return -ENOSYS;
+}
+
+static inline int drm_pci_set_busid(struct drm_device *dev,
+                                   struct drm_master *master)
+{
+       return -ENOSYS;
+}
+#endif
 
 #define DRM_PCIE_SPEED_25 1
 #define DRM_PCIE_SPEED_50 2