drm: kill drm_device->irq
authorJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 15 Sep 2008 22:00:33 +0000 (15:00 -0700)
committerDave Airlie <airlied@linux.ie>
Fri, 17 Oct 2008 21:10:53 +0000 (07:10 +1000)
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>
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/drm_stub.c
drivers/gpu/drm/mga/mga_state.c
drivers/gpu/drm/r128/r128_state.c
drivers/gpu/drm/radeon/radeon_state.c
drivers/gpu/drm/via/via_irq.c
drivers/gpu/drm/via/via_mm.c
include/drm/drmP.h

index d0c13d954f529d1673461f0c9968e1113bec1cb0..4091b9e291f918be5f23a8391b48aa391d498f9c 100644 (file)
@@ -228,12 +228,9 @@ int drm_irq_install(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
                sh_flags = IRQF_SHARED;
 
-       ret = request_irq(dev->pdev->irq, dev->driver->irq_handler,
+       ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
                          sh_flags, dev->devname, dev);
-       /* Expose the device irq number to drivers that want to export it for
-        * whatever reason.
-        */
-       dev->irq = dev->pdev->irq;
+
        if (ret < 0) {
                mutex_lock(&dev->struct_mutex);
                dev->irq_enabled = 0;
index 82f4657b8879099550e0c6252aa31eaf15968bc1..141e33004a7605c31fcdd7814f5e0fdc767d3e08 100644 (file)
@@ -107,7 +107,6 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
 #ifdef __alpha__
        dev->hose = pdev->sysdata;
 #endif
-       dev->irq = pdev->irq;
 
        if (drm_ht_create(&dev->map_hash, 12)) {
                return -ENOMEM;
index d3f8aade07b336be0d6d37d2a1e09913669d5680..b710fab21cb375e946d19ec099a1c1c81208a72a 100644 (file)
@@ -1022,7 +1022,7 @@ static int mga_getparam(struct drm_device *dev, void *data, struct drm_file *fil
 
        switch (param->param) {
        case MGA_PARAM_IRQ_NR:
-               value = dev->irq;
+               value = drm_dev_to_irq(dev);
                break;
        case MGA_PARAM_CARD_TYPE:
                value = dev_priv->chipset;
index 51a9afce7b9b9b5e9a9a965fc8091078d3edca05..f7a5b5740764040840421e990c27e377a1efac31 100644 (file)
@@ -1629,7 +1629,7 @@ static int r128_getparam(struct drm_device *dev, void *data, struct drm_file *fi
 
        switch (param->param) {
        case R128_PARAM_IRQ_NR:
-               value = dev->irq;
+               value = drm_dev_to_irq(dev);
                break;
        default:
                return -EINVAL;
index 11c146b49211de3581cbc2daaab9815af885cec9..5d7153fcc7b0063625a8232e66b6f89b09a042c3 100644 (file)
@@ -2997,7 +2997,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
                value = GET_SCRATCH(2);
                break;
        case RADEON_PARAM_IRQ_NR:
-               value = dev->irq;
+               value = drm_dev_to_irq(dev);
                break;
        case RADEON_PARAM_GART_BASE:
                value = dev_priv->gart_vm_start;
index 1b966fbdb49f449d7a53856a530564e50ba27c0a..665d319b927b2d3a07cc25a65ebccbc33b1160aa 100644 (file)
@@ -354,9 +354,6 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
        drm_via_irq_t *cur_irq = dev_priv->via_irqs;
        int force_sequence;
 
-       if (!dev->irq)
-               return -EINVAL;
-
        if (irqwait->request.irq >= dev_priv->num_irqs) {
                DRM_ERROR("Trying to wait on unknown irq %d\n",
                          irqwait->request.irq);
index e64094916e4fcf3f26b6482702c218a55583ec7f..f694cb5ededca2ccfc74bd712b60a0cd06248bce 100644 (file)
@@ -93,8 +93,7 @@ int via_final_context(struct drm_device *dev, int context)
        /* Last context, perform cleanup */
        if (dev->ctx_count == 1 && dev->dev_private) {
                DRM_DEBUG("Last Context\n");
-               if (dev->irq)
-                       drm_irq_uninstall(dev);
+               drm_irq_uninstall(dev);
                via_cleanup_futex(dev_priv);
                via_do_cleanup_map(dev);
        }
index 51ee72c962b139946def320e2c3edd3b405d26a8..90a9e0247d58a4ffd238149862defe9a7ec28394 100644 (file)
@@ -824,7 +824,6 @@ struct drm_device {
 
        /** \name Context support */
        /*@{ */
-       int irq;                        /**< Interrupt used by board */
        int irq_enabled;                /**< True if irq handler is enabled */
        __volatile__ long context_flag; /**< Context swapping flag */
        __volatile__ long interrupt_flag; /**< Interruption handler flag */
@@ -915,6 +914,11 @@ struct drm_device {
 
 };
 
+static inline int drm_dev_to_irq(struct drm_device *dev)
+{
+       return dev->pdev->irq;
+}
+
 static __inline__ int drm_core_check_feature(struct drm_device *dev,
                                             int feature)
 {