aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mga
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/mga
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/mga')
-rw-r--r--drivers/gpu/drm/mga/mga_dma.c2
-rw-r--r--drivers/gpu/drm/mga/mga_drv.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index 08868ac3048a..1e1eb1d7e971 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -703,7 +703,7 @@ static int mga_do_pci_dma_bootstrap(struct drm_device *dev,
703static int mga_do_dma_bootstrap(struct drm_device *dev, 703static int mga_do_dma_bootstrap(struct drm_device *dev,
704 drm_mga_dma_bootstrap_t *dma_bs) 704 drm_mga_dma_bootstrap_t *dma_bs)
705{ 705{
706 const int is_agp = (dma_bs->agp_mode != 0) && drm_device_is_agp(dev); 706 const int is_agp = (dma_bs->agp_mode != 0) && drm_pci_device_is_agp(dev);
707 int err; 707 int err;
708 drm_mga_private_t *const dev_priv = 708 drm_mga_private_t *const dev_priv =
709 (drm_mga_private_t *) dev->dev_private; 709 (drm_mga_private_t *) dev->dev_private;
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 0aaf5f67a436..42d31874edf2 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -75,10 +75,6 @@ static struct drm_driver driver = {
75#endif 75#endif
76 .llseek = noop_llseek, 76 .llseek = noop_llseek,
77 }, 77 },
78 .pci_driver = {
79 .name = DRIVER_NAME,
80 .id_table = pciidlist,
81 },
82 78
83 .name = DRIVER_NAME, 79 .name = DRIVER_NAME,
84 .desc = DRIVER_DESC, 80 .desc = DRIVER_DESC,
@@ -88,15 +84,20 @@ static struct drm_driver driver = {
88 .patchlevel = DRIVER_PATCHLEVEL, 84 .patchlevel = DRIVER_PATCHLEVEL,
89}; 85};
90 86
87static struct pci_driver mga_pci_driver = {
88 .name = DRIVER_NAME,
89 .id_table = pciidlist,
90};
91
91static int __init mga_init(void) 92static int __init mga_init(void)
92{ 93{
93 driver.num_ioctls = mga_max_ioctl; 94 driver.num_ioctls = mga_max_ioctl;
94 return drm_init(&driver); 95 return drm_pci_init(&driver, &mga_pci_driver);
95} 96}
96 97
97static void __exit mga_exit(void) 98static void __exit mga_exit(void)
98{ 99{
99 drm_exit(&driver); 100 drm_pci_exit(&driver, &mga_pci_driver);
100} 101}
101 102
102module_init(mga_init); 103module_init(mga_init);