drm: Remove drm_driver->set_busid hook
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 24 May 2017 14:51:39 +0000 (16:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 Jun 2017 08:40:49 +0000 (10:40 +0200)
The only special-case is pci devices, and we can easily handle this in
the core. Do so and drop a pile of boilerplate from drivers.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-5-daniel.vetter@ffwll.ch
23 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/ast/ast_drv.c
drivers/gpu/drm/bochs/bochs_drv.c
drivers/gpu/drm/cirrus/cirrus_drv.c
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/i810/i810_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/mga/mga_drv.c
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/r128/r128_drv.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/savage/savage_drv.c
drivers/gpu/drm/sis/sis_drv.c
drivers/gpu/drm/tdfx/tdfx_drv.c
drivers/gpu/drm/via/via_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
include/drm/drm_drv.h
include/drm/drm_pci.h

index 31eddd85eb40902c99e9ee440d82870e0bdfd329..e7a4bce6358d849ec8465d6925df358529a7a3e6 100644 (file)
@@ -734,7 +734,6 @@ static struct drm_driver kms_driver = {
        .open = amdgpu_driver_open_kms,
        .postclose = amdgpu_driver_postclose_kms,
        .lastclose = amdgpu_driver_lastclose_kms,
-       .set_busid = drm_pci_set_busid,
        .unload = amdgpu_driver_unload_kms,
        .get_vblank_counter = amdgpu_get_vblank_counter_kms,
        .enable_vblank = amdgpu_enable_vblank_kms,
index fd7c9eec92e4d75eba8aeb935d6dbcd2e122c1f7..f6794745a024bf9d9b6784ba1a0345a61b2edad9 100644 (file)
@@ -197,7 +197,6 @@ static struct drm_driver driver = {
 
        .load = ast_driver_load,
        .unload = ast_driver_unload,
-       .set_busid = drm_pci_set_busid,
 
        .fops = &ast_fops,
        .name = DRIVER_NAME,
index aa342515ddf43c86f00b9082812305d96eef65e3..8fccd3cf000d6e12ff3aebb832aeba74badab571 100644 (file)
@@ -84,7 +84,6 @@ static struct drm_driver bochs_driver = {
        .driver_features        = DRIVER_GEM | DRIVER_MODESET,
        .load                   = bochs_load,
        .unload                 = bochs_unload,
-       .set_busid              = drm_pci_set_busid,
        .fops                   = &bochs_fops,
        .name                   = "bochs-drm",
        .desc                   = "bochs dispi vga interface (qemu stdvga)",
index d893ea21a359226400d56920d663db3d2c4c1083..c48b9eb767121055d0980aec44bd8f7765ac0818 100644 (file)
@@ -132,7 +132,6 @@ static struct drm_driver driver = {
        .driver_features = DRIVER_MODESET | DRIVER_GEM,
        .load = cirrus_driver_load,
        .unload = cirrus_driver_unload,
-       .set_busid = drm_pci_set_busid,
        .fops = &cirrus_driver_fops,
        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
index 5cf9e03b54570323f619893df1f7f64dda306097..116de27cf8f3e764f7ed04b75d07558a3eea0d70 100644 (file)
@@ -32,6 +32,7 @@ void drm_lastclose(struct drm_device *dev);
 int drm_irq_by_busid(struct drm_device *dev, void *data,
                     struct drm_file *file_priv);
 void drm_pci_agp_destroy(struct drm_device *dev);
+int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
 
 /* drm_prime.c */
 int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
index c8547d223e85655cc0d427ff0d30d8d0f476faac..aa49a2241404b328db1ae5e5d4a457718606289a 100644 (file)
@@ -143,8 +143,8 @@ static int drm_set_busid(struct drm_device *dev, struct drm_file *file_priv)
        if (master->unique != NULL)
                drm_unset_busid(dev, master);
 
-       if (dev->driver->set_busid) {
-               ret = dev->driver->set_busid(dev, master);
+       if (dev_is_pci(dev->dev)) {
+               ret = drm_pci_set_busid(dev, master);
                if (ret) {
                        drm_unset_busid(dev, master);
                        return ret;
index 1eb4fc3eee20ad46ff44f917440f2d599ab80412..ad31d95e77c9a25b061b67ec4c8c07f44a69ab82 100644 (file)
@@ -149,7 +149,6 @@ int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
        master->unique_len = strlen(master->unique);
        return 0;
 }
-EXPORT_SYMBOL(drm_pci_set_busid);
 
 static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
 {
index 1f9b35afefeebc9f66ad6e018afe479f4b8b0df0..37d4c36c80f2e4037001f7f19d67bb4c1eb3392c 100644 (file)
@@ -480,7 +480,6 @@ static struct drm_driver driver = {
        .load = psb_driver_load,
        .unload = psb_driver_unload,
        .lastclose = psb_driver_lastclose,
-       .set_busid = drm_pci_set_busid,
 
        .num_ioctls = ARRAY_SIZE(psb_ioctls),
        .irq_preinstall = psb_irq_preinstall,
index 37fd0906f807f0224b78a535746fbd41024e3f56..e1c35c710e24b9a7cab39cae3dedc405c5d7e147 100644 (file)
@@ -59,7 +59,6 @@ static struct drm_driver driver = {
        .load = i810_driver_load,
        .lastclose = i810_driver_lastclose,
        .preclose = i810_driver_preclose,
-       .set_busid = drm_pci_set_busid,
        .dma_quiescent = i810_driver_dma_quiescent,
        .ioctls = i810_ioctls,
        .fops = &i810_driver_fops,
index 3036d4835b0fa7a3b366a31d0b6ed18fc7889ae1..6033355d9469da1972f3e85e37954e617400630b 100644 (file)
@@ -2622,7 +2622,6 @@ static struct drm_driver driver = {
        .open = i915_driver_open,
        .lastclose = i915_driver_lastclose,
        .postclose = i915_driver_postclose,
-       .set_busid = drm_pci_set_busid,
 
        .gem_close_object = i915_gem_close_object,
        .gem_free_object_unlocked = i915_gem_free_object,
index 63ba0699d107e0ca0247ca78336ab1151f3284a0..2a36ec611a44c02448d5379a6f8e11d478aeaed3 100644 (file)
@@ -62,7 +62,6 @@ static struct drm_driver driver = {
        .load = mga_driver_load,
        .unload = mga_driver_unload,
        .lastclose = mga_driver_lastclose,
-       .set_busid = drm_pci_set_busid,
        .dma_quiescent = mga_driver_dma_quiescent,
        .get_vblank_counter = mga_get_vblank_counter,
        .enable_vblank = mga_enable_vblank,
index 9ac007880328b7659130b81b196ae92d7230929c..53a5982a04c70de3787fd25b873f4f5004d99537 100644 (file)
@@ -91,7 +91,6 @@ static struct drm_driver driver = {
        .driver_features = DRIVER_GEM | DRIVER_MODESET,
        .load = mgag200_driver_load,
        .unload = mgag200_driver_unload,
-       .set_busid = drm_pci_set_busid,
        .fops = &mgag200_driver_fops,
        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
index c3dc75fee700e3018c8ffe28fbdcec37209782a4..3e1a8da9b20f3da4067629211fcd4851328f040d 100644 (file)
@@ -1102,7 +1102,6 @@ static int __init
 nouveau_drm_init(void)
 {
        driver_pci = driver_stub;
-       driver_pci.set_busid = drm_pci_set_busid;
        driver_platform = driver_stub;
 
        nouveau_display_options();
index c2fc201d9e1ba87a7e61722bc297b36a5e5c112b..bb2d8da7e553ad2572f6122c1275328b4863ce43 100644 (file)
@@ -262,8 +262,6 @@ static struct drm_driver qxl_driver = {
                           DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
                           DRIVER_ATOMIC,
 
-       .set_busid = drm_pci_set_busid,
-
        .dumb_create = qxl_mode_dumb_create,
        .dumb_map_offset = qxl_mode_dumb_mmap,
        .dumb_destroy = drm_gem_dumb_destroy,
index a982be57d1efb44b0638f55faa18621dcdc14fce..1d43c434328daf3bbc106da20e8f4f33e61ecb25 100644 (file)
@@ -62,7 +62,6 @@ static struct drm_driver driver = {
        .load = r128_driver_load,
        .preclose = r128_driver_preclose,
        .lastclose = r128_driver_lastclose,
-       .set_busid = drm_pci_set_busid,
        .get_vblank_counter = r128_get_vblank_counter,
        .enable_vblank = r128_enable_vblank,
        .disable_vblank = r128_disable_vblank,
index 6f906abd612b76836a2f420cfbd7b3d887195f3f..dd5e86dafb296c114791ed12de1d9b46c085d6ef 100644 (file)
@@ -545,7 +545,6 @@ static struct drm_driver kms_driver = {
        .open = radeon_driver_open_kms,
        .postclose = radeon_driver_postclose_kms,
        .lastclose = radeon_driver_lastclose_kms,
-       .set_busid = drm_pci_set_busid,
        .unload = radeon_driver_unload_kms,
        .get_vblank_counter = radeon_get_vblank_counter_kms,
        .enable_vblank = radeon_enable_vblank_kms,
index 78c6d8e9b42c1fc149b259baa62ace6ccdf0f3df..2a08da09dbcf39e213312f940c10d2ac0734037b 100644 (file)
@@ -55,7 +55,6 @@ static struct drm_driver driver = {
        .preclose = savage_reclaim_buffers,
        .lastclose = savage_driver_lastclose,
        .unload = savage_driver_unload,
-       .set_busid = drm_pci_set_busid,
        .ioctls = savage_ioctls,
        .dma_ioctl = savage_bci_buffers,
        .fops = &savage_driver_fops,
index 7f05da13ea5ed44729d4d3349a39ce004a23df99..cdaced381f5d64fdb0da38337b524f3ffd954f46 100644 (file)
@@ -104,7 +104,6 @@ static struct drm_driver driver = {
        .open = sis_driver_open,
        .preclose = sis_reclaim_buffers_locked,
        .postclose = sis_driver_postclose,
-       .set_busid = drm_pci_set_busid,
        .dma_quiescent = sis_idle,
        .lastclose = sis_lastclose,
        .ioctls = sis_ioctls,
index c54138c3a3768f07962e2bed294e9d827f85681f..acd5f8162bb66a242c13e46230a0e67bb637fdbb 100644 (file)
@@ -55,7 +55,6 @@ static const struct file_operations tdfx_driver_fops = {
 
 static struct drm_driver driver = {
        .driver_features = DRIVER_LEGACY,
-       .set_busid = drm_pci_set_busid,
        .fops = &tdfx_driver_fops,
        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
index 9e0e5392b6ecb93cb1d6569c0eaaf7bacb48728f..0ca4e0489c0b66ede43281efbf1e6d329cc4f1c6 100644 (file)
@@ -77,7 +77,6 @@ static struct drm_driver driver = {
        .open = via_driver_open,
        .preclose = via_reclaim_buffers_locked,
        .postclose = via_driver_postclose,
-       .set_busid = drm_pci_set_busid,
        .context_dtor = via_final_context,
        .get_vblank_counter = via_get_vblank_counter,
        .enable_vblank = via_enable_vblank,
index 4a641555b960b8fc654c6ab89c428e783a61aad4..63218033b0bea12373b2f9553727840167e19525 100644 (file)
@@ -1531,7 +1531,6 @@ static struct drm_driver driver = {
        .master_drop = vmw_master_drop,
        .open = vmw_driver_open,
        .postclose = vmw_postclose,
-       .set_busid = drm_pci_set_busid,
 
        .dumb_create = vmw_dumb_create,
        .dumb_map_offset = vmw_dumb_map_offset,
index 18f3181674e8a281bb56f35eba5b365e9970df2b..e4de59bc52c8f6aa8094beb6453733d8472c5793 100644 (file)
@@ -172,8 +172,6 @@ struct drm_driver {
         */
        void (*release) (struct drm_device *);
 
-       int (*set_busid)(struct drm_device *dev, struct drm_master *master);
-
        /**
         * @get_vblank_counter:
         *
index 4579fac1080c665b49b9fb3572768072f17228cd..961b16f9b5533806475cf74d6efcb2b16a96acdb 100644 (file)
@@ -49,7 +49,6 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
 int drm_get_pci_dev(struct pci_dev *pdev,
                    const struct pci_device_id *ent,
                    struct drm_driver *driver);
-int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
 #else
 static inline int drm_get_pci_dev(struct pci_dev *pdev,
                                  const struct pci_device_id *ent,
@@ -57,12 +56,6 @@ static inline int drm_get_pci_dev(struct pci_dev *pdev,
 {
        return -ENOSYS;
 }
-
-static inline int drm_pci_set_busid(struct drm_device *dev,
-                                   struct drm_master *master)
-{
-       return -ENOSYS;
-}
 #endif
 
 #define DRM_PCIE_SPEED_25 1