Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: kill drm_device->irq

Like the last patch but adds a macro to get at the irq value instead of
dereferencing pdev directly. Should make things easier for the BSD guys and
if we ever support non-PCI devices.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Jesse Barnes and committed by
Dave Airlie
9bfbd5cb e0f0754f

+11 -15
+2 -5
drivers/gpu/drm/drm_irq.c
··· 228 228 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) 229 229 sh_flags = IRQF_SHARED; 230 230 231 - ret = request_irq(dev->pdev->irq, dev->driver->irq_handler, 231 + ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler, 232 232 sh_flags, dev->devname, dev); 233 - /* Expose the device irq number to drivers that want to export it for 234 - * whatever reason. 235 - */ 236 - dev->irq = dev->pdev->irq; 233 + 237 234 if (ret < 0) { 238 235 mutex_lock(&dev->struct_mutex); 239 236 dev->irq_enabled = 0;
-1
drivers/gpu/drm/drm_stub.c
··· 107 107 #ifdef __alpha__ 108 108 dev->hose = pdev->sysdata; 109 109 #endif 110 - dev->irq = pdev->irq; 111 110 112 111 if (drm_ht_create(&dev->map_hash, 12)) { 113 112 return -ENOMEM;
+1 -1
drivers/gpu/drm/mga/mga_state.c
··· 1022 1022 1023 1023 switch (param->param) { 1024 1024 case MGA_PARAM_IRQ_NR: 1025 - value = dev->irq; 1025 + value = drm_dev_to_irq(dev); 1026 1026 break; 1027 1027 case MGA_PARAM_CARD_TYPE: 1028 1028 value = dev_priv->chipset;
+1 -1
drivers/gpu/drm/r128/r128_state.c
··· 1629 1629 1630 1630 switch (param->param) { 1631 1631 case R128_PARAM_IRQ_NR: 1632 - value = dev->irq; 1632 + value = drm_dev_to_irq(dev); 1633 1633 break; 1634 1634 default: 1635 1635 return -EINVAL;
+1 -1
drivers/gpu/drm/radeon/radeon_state.c
··· 2997 2997 value = GET_SCRATCH(2); 2998 2998 break; 2999 2999 case RADEON_PARAM_IRQ_NR: 3000 - value = dev->irq; 3000 + value = drm_dev_to_irq(dev); 3001 3001 break; 3002 3002 case RADEON_PARAM_GART_BASE: 3003 3003 value = dev_priv->gart_vm_start;
-3
drivers/gpu/drm/via/via_irq.c
··· 354 354 drm_via_irq_t *cur_irq = dev_priv->via_irqs; 355 355 int force_sequence; 356 356 357 - if (!dev->irq) 358 - return -EINVAL; 359 - 360 357 if (irqwait->request.irq >= dev_priv->num_irqs) { 361 358 DRM_ERROR("Trying to wait on unknown irq %d\n", 362 359 irqwait->request.irq);
+1 -2
drivers/gpu/drm/via/via_mm.c
··· 93 93 /* Last context, perform cleanup */ 94 94 if (dev->ctx_count == 1 && dev->dev_private) { 95 95 DRM_DEBUG("Last Context\n"); 96 - if (dev->irq) 97 - drm_irq_uninstall(dev); 96 + drm_irq_uninstall(dev); 98 97 via_cleanup_futex(dev_priv); 99 98 via_do_cleanup_map(dev); 100 99 }
+5 -1
include/drm/drmP.h
··· 824 824 825 825 /** \name Context support */ 826 826 /*@{ */ 827 - int irq; /**< Interrupt used by board */ 828 827 int irq_enabled; /**< True if irq handler is enabled */ 829 828 __volatile__ long context_flag; /**< Context swapping flag */ 830 829 __volatile__ long interrupt_flag; /**< Interruption handler flag */ ··· 913 914 /*@} */ 914 915 915 916 }; 917 + 918 + static inline int drm_dev_to_irq(struct drm_device *dev) 919 + { 920 + return dev->pdev->irq; 921 + } 916 922 917 923 static __inline__ int drm_core_check_feature(struct drm_device *dev, 918 924 int feature)