aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2010-12-14 12:16:38 -0500
committerDave Airlie <airlied@redhat.com>2011-02-06 22:09:36 -0500
commit8410ea3b95d105a5be5db501656f44bbb91197c1 (patch)
tree6cd27f207e50c13ba2f4a78d6323bc23f751e380 /drivers/gpu/drm/drm_drv.c
parentff72145badb834e8051719ea66e024784d000cb4 (diff)
drm: rework PCI/platform driver interface.
This abstracts the pci/platform interface out a step further, we can go further but this is far enough for now to allow USB to be plugged in. The drivers now just call the init code directly for their device type. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 3e991980cee2..0d04914eb058 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -237,49 +237,6 @@ int drm_lastclose(struct drm_device * dev)
237 return 0; 237 return 0;
238} 238}
239 239
240/**
241 * Module initialization. Called via init_module at module load time, or via
242 * linux/init/main.c (this is not currently supported).
243 *
244 * \return zero on success or a negative number on failure.
245 *
246 * Initializes an array of drm_device structures, and attempts to
247 * initialize all available devices, using consecutive minors, registering the
248 * stubs and initializing the device.
249 *
250 * Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
251 * after the initialization for driver customization.
252 */
253int drm_init(struct drm_driver *driver)
254{
255 DRM_DEBUG("\n");
256 INIT_LIST_HEAD(&driver->device_list);
257
258 if (driver->driver_features & DRIVER_USE_PLATFORM_DEVICE)
259 return drm_platform_init(driver);
260 else
261 return drm_pci_init(driver);
262}
263
264EXPORT_SYMBOL(drm_init);
265
266void drm_exit(struct drm_driver *driver)
267{
268 struct drm_device *dev, *tmp;
269 DRM_DEBUG("\n");
270
271 if (driver->driver_features & DRIVER_MODESET) {
272 pci_unregister_driver(&driver->pci_driver);
273 } else {
274 list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item)
275 drm_put_dev(dev);
276 }
277
278 DRM_INFO("Module unloaded\n");
279}
280
281EXPORT_SYMBOL(drm_exit);
282
283/** File operations structure */ 240/** File operations structure */
284static const struct file_operations drm_stub_fops = { 241static const struct file_operations drm_stub_fops = {
285 .owner = THIS_MODULE, 242 .owner = THIS_MODULE,