diff options
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index a75ca63deea..26005d93ad0 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -247,6 +247,7 @@ int drm_lastclose(struct drm_device * dev) */ int drm_init(struct drm_driver *driver) { +#ifdef CONFIG_PCI struct pci_dev *pdev = NULL; const struct pci_device_id *pid; int i; @@ -280,11 +281,37 @@ int drm_init(struct drm_driver *driver) drm_get_dev(pdev, pid, driver); } } +#endif return 0; } EXPORT_SYMBOL(drm_init); +/** + * Call this to associate a drm_driver with a platform_device. + * + * \return zero on success or a negative number on failure. + * + * This is a replacement for drm_init(), but for platform drivers. + * In this case, the caller must provide the matching platform_device + * + * since there is no physical bus to scan through. + * + * \sa drm_init + * + */ +int drm_platform_init(struct drm_driver *driver, struct platform_device *pdev, + void *priv) +{ + DRM_DEBUG("\n"); + + INIT_LIST_HEAD(&driver->device_list); + + return drm_get_platform_dev(pdev, driver, priv); +} + +EXPORT_SYMBOL(drm_platform_init); + void drm_exit(struct drm_driver *driver) { struct drm_device *dev, *tmp; |