@@ -1663,9 +1663,18 @@ 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);
+#else
+static inline int drm_get_pci_dev(struct pci_dev *pdev,
+ const struct pci_device_id *ent,
+ struct drm_driver *driver)
+{
+ return -ENOSYS;
+}
+#endif
#define DRM_PCIE_SPEED_25 1
#define DRM_PCIE_SPEED_50 2
@@ -44,16 +44,12 @@ typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
struct device *, unsigned long, int, void *);
struct iommu {
+ const struct iommu_ops *ops;
struct device *dev;
struct list_head list;
-
- const struct iommu_ops *ops;
};
-int iommu_add(struct iommu *iommu);
-void iommu_remove(struct iommu *iommu);
-
struct iommu_domain_geometry {
dma_addr_t aperture_start; /* First address that can be mapped */
dma_addr_t aperture_end; /* Last address that can be mapped */
@@ -154,6 +150,9 @@ struct iommu_ops {
#ifdef CONFIG_IOMMU_API
+extern int iommu_add(struct iommu *iommu);
+extern void iommu_remove(struct iommu *iommu);
+
extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops);
extern bool iommu_present(struct bus_type *bus);
extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
@@ -260,6 +259,15 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
#else /* CONFIG_IOMMU_API */
+static inline int iommu_add(struct iommu *iommu)
+{
+ return -ENOSYS;
+}
+
+static inline void iommu_remove(struct iommu *iommu)
+{
+}
+
static inline int bus_set_iommu(struct bus_type *bus,
const struct iommu_ops *ops)
{