drm/pci: define drm_pcie_get_speed_cap_mask() only when CONFIG_PCI=y
Move drm_pcie_get_speed_cap_mask() under #ifdef CONFIG_PCI because it it used only for PCI devices (evergreen, r600, r770), and it uses PCI interfaces that only exist when CONFIG_PCI=y. Previously, we tried to compile drm_pcie_get_speed_cap_mask() even when CONFIG_PCI=n, which fails. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Родитель
db3985e5ca
Коммит
93711d8bec
|
@ -439,33 +439,6 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(drm_pci_init);
|
||||
|
||||
/*@}*/
|
||||
void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||
{
|
||||
struct drm_device *dev, *tmp;
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
if (driver->driver_features & DRIVER_MODESET) {
|
||||
pci_unregister_driver(pdriver);
|
||||
} else {
|
||||
list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item)
|
||||
drm_put_dev(dev);
|
||||
}
|
||||
DRM_INFO("Module unloaded\n");
|
||||
}
|
||||
EXPORT_SYMBOL(drm_pci_exit);
|
||||
|
||||
int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
|
||||
{
|
||||
struct pci_dev *root;
|
||||
|
@ -503,3 +476,30 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
|
|||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_pcie_get_speed_cap_mask);
|
||||
|
||||
#else
|
||||
|
||||
int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(drm_pci_init);
|
||||
|
||||
/*@}*/
|
||||
void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||
{
|
||||
struct drm_device *dev, *tmp;
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
if (driver->driver_features & DRIVER_MODESET) {
|
||||
pci_unregister_driver(pdriver);
|
||||
} else {
|
||||
list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item)
|
||||
drm_put_dev(dev);
|
||||
}
|
||||
DRM_INFO("Module unloaded\n");
|
||||
}
|
||||
EXPORT_SYMBOL(drm_pci_exit);
|
||||
|
|
Загрузка…
Ссылка в новой задаче