powerpc: Use proper accessors for IRQ_* flags
authorThomas Gleixner <tglx@linutronix.de>
Fri, 25 Mar 2011 14:43:57 +0000 (15:43 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 29 Mar 2011 12:48:08 +0000 (14:48 +0200)
Use the proper accessors instead of open access to irq_desc.
Converted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
20 files changed:
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
arch/powerpc/platforms/52xx/media5200.c
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
arch/powerpc/platforms/86xx/gef_pic.c
arch/powerpc/platforms/cell/beat_interrupt.c
arch/powerpc/platforms/embedded6xx/flipper-pic.c
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/sysdev/cpm1.c
arch/powerpc/sysdev/cpm2_pic.c
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/mv64x60_pic.c
arch/powerpc/sysdev/qe_lib/qe_ic.c
arch/powerpc/sysdev/tsi108_pci.c
arch/powerpc/sysdev/uic.c

index 0a5570338b96c6bef5bdda5769e0c5be066b2cda..8f7da4402e9be8947e9a99095b2328197043fb96 100644 (file)
@@ -618,7 +618,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
                        smp_wmb();
 
                        /* Clear norequest flags */
-                       irq_to_desc(i)->status &= ~IRQ_NOREQUEST;
+                       irq_clear_status_flags(i, IRQ_NOREQUEST);
 
                        /* Legacy flags are left to default at this point,
                         * one can then use irq_create_mapping() to
index bd1e1ff17b2d585ec60a4fcdec0d6b8a08e43a52..2d65e9eef31ec30103699f5dcdefd21fa12f855d 100644 (file)
@@ -35,13 +35,13 @@ void machine_kexec_mask_interrupts(void) {
                if (!chip)
                        continue;
 
-               if (chip->irq_eoi && desc->status & IRQ_INPROGRESS)
+               if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
                        chip->irq_eoi(&desc->irq_data);
 
                if (chip->irq_mask)
                        chip->irq_mask(&desc->irq_data);
 
-               if (chip->irq_disable && !(desc->status & IRQ_DISABLED))
+               if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
                        chip->irq_disable(&desc->irq_data);
        }
 }
index fde0ea50c97d1aca4810b1bd86e8b4a712194dcd..529897cef60c660f7a1c6cb461be024f4816847a 100644 (file)
@@ -132,7 +132,7 @@ static int
 cpld_pic_host_map(struct irq_host *h, unsigned int virq,
                             irq_hw_number_t hw)
 {
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &cpld_pic, handle_level_irq);
        return 0;
 }
index 2bd1e6cf1f58b4fa3babdc61b50713791bc6346c..6cd041baa7275d1d27218209b05ce0ce87c7dbe3 100644 (file)
@@ -107,7 +107,7 @@ void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
        /* Processing done; can reenable the cascade now */
        raw_spin_lock(&desc->lock);
        chip->irq_ack(&desc->irq_data);
-       if (!(desc->status & IRQ_DISABLED))
+       if (!irqd_irq_disabled(&desc->irq_data))
                chip->irq_unmask(&desc->irq_data);
        raw_spin_unlock(&desc->lock);
 }
index 926dfdaaf57aeccdad4bc4e1a508b87353038b14..45afeb0e5a45433b04e97773e36b71033cffba1f 100644 (file)
@@ -106,7 +106,7 @@ static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
 static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
                            irq_hw_number_t hw)
 {
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_data(virq, h->host_data);
        set_irq_chip_and_handler(virq, &pq2ads_pci_ic, handle_level_irq);
        return 0;
index 79d85aca476719830e6d440a36fbef30c82a31cf..ecb0495ca8804060701d2d5965dbafeeab526edd 100644 (file)
@@ -245,7 +245,7 @@ static int socrates_fpga_pic_host_map(struct irq_host *h, unsigned int virq,
                irq_hw_number_t hwirq)
 {
        /* All interrupts are LEVEL sensitive */
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &socrates_fpga_pic_chip,
                        handle_fasteoi_irq);
 
index 0adfe3b740cd69bb938c6ab8e1ffd321f05a43d8..9a85ac15b6fc2f4776878288d57ff1dff080de82 100644 (file)
@@ -163,7 +163,7 @@ static int gef_pic_host_map(struct irq_host *h, unsigned int virq,
                          irq_hw_number_t hwirq)
 {
        /* All interrupts are LEVEL sensitive */
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &gef_pic_chip, handle_level_irq);
 
        return 0;
index 0b8f7d7135c507c11fd0ccc828014de2b94524dd..0280042b3e8cb648096580c8affcb62131ab41f3 100644 (file)
@@ -136,14 +136,13 @@ static void beatic_pic_host_unmap(struct irq_host *h, unsigned int virq)
 static int beatic_pic_host_map(struct irq_host *h, unsigned int virq,
                               irq_hw_number_t hw)
 {
-       struct irq_desc *desc = irq_to_desc(virq);
        int64_t err;
 
        err = beat_construct_and_connect_irq_plug(virq, hw);
        if (err < 0)
                return -EIO;
 
-       desc->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &beatic_pic, handle_fasteoi_irq);
        return 0;
 }
index 0aca0e28a8e546305a22a05f9c2b5e1f040215f0..9d6c3abbfa96c9a1fdb3aa8482ad88201562fd04 100644 (file)
@@ -102,7 +102,7 @@ static int flipper_pic_map(struct irq_host *h, unsigned int virq,
                           irq_hw_number_t hwirq)
 {
        set_irq_chip_data(virq, h->host_data);
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &flipper_pic, handle_level_irq);
        return 0;
 }
index 35e448bd84796c26b640fe2f3d9cff56783179d1..e6e620831399606d7d65393298708a5642c0c99b 100644 (file)
@@ -95,7 +95,7 @@ static int hlwd_pic_map(struct irq_host *h, unsigned int virq,
                           irq_hw_number_t hwirq)
 {
        set_irq_chip_data(virq, h->host_data);
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &hlwd_pic, handle_level_irq);
        return 0;
 }
@@ -145,7 +145,7 @@ static void hlwd_pic_irq_cascade(unsigned int cascade_virq,
 
        raw_spin_lock(&desc->lock);
        chip->irq_ack(&desc->irq_data); /* IRQ_LEVEL */
-       if (!(desc->status & IRQ_DISABLED) && chip->irq_unmask)
+       if (!irqd_irq_disabled(&desc->irq_data) && chip->irq_unmask)
                chip->irq_unmask(&desc->irq_data);
        raw_spin_unlock(&desc->lock);
 }
index c55812bb6a5140d75617a645fc72b70d47f441bf..22f45d74a584494546bec9b597256ccc80bc3c42 100644 (file)
@@ -289,7 +289,6 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node)
 static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
                             irq_hw_number_t hw)
 {
-       struct irq_desc *desc = irq_to_desc(virq);
        int level;
 
        if (hw >= max_irqs)
@@ -300,7 +299,7 @@ static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
         */
        level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f)));
        if (level)
-               desc->status |= IRQ_LEVEL;
+               irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &pmac_pic, level ?
                                 handle_level_irq : handle_edge_irq);
        return 0;
index 01fea46c03353b63a154c6b6441e9725d3d21298..f4bf8a932fefe2d85caed5014440188c9eafa5e9 100644 (file)
@@ -470,7 +470,7 @@ static int xics_host_map(struct irq_host *h, unsigned int virq,
        /* Insert the interrupt mapping into the radix tree for fast lookup */
        irq_radix_revmap_insert(xics_host, virq, hw);
 
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
        return 0;
 }
index 0476bcc7c3e14857a33aebad80a8a0abd1cc2ceb..6ee2af26136f1ac8b856dc2b2d6033d20fbbfe62 100644 (file)
@@ -103,7 +103,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
 {
        pr_debug("cpm_pic_host_map(%d, 0x%lx)\n", virq, hw);
 
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &cpm_pic, handle_fasteoi_irq);
        return 0;
 }
index 473032556715130f3664bf112e6adda4ead4caa6..8ffe164e95ad258f044016f714011221f6740c36 100644 (file)
@@ -226,7 +226,7 @@ static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
 {
        pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw);
 
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &cpm2_pic, handle_level_irq);
        return 0;
 }
index 58e09b2833f2ce8111673de016a32e44e7cf8063..71965c6ca632a86efcd04d238be138dbc6c76d4d 100644 (file)
@@ -64,7 +64,7 @@ static int fsl_msi_host_map(struct irq_host *h, unsigned int virq,
        struct fsl_msi *msi_data = h->host_data;
        struct irq_chip *chip = &fsl_msi_chip;
 
-       irq_to_desc(virq)->status |= IRQ_TYPE_EDGE_FALLING;
+       irq_set_status_flags(virq, IRQ_TYPE_EDGE_FALLING);
 
        set_irq_chip_data(virq, msi_data);
        set_irq_chip_and_handler(virq, chip, handle_edge_irq);
index aeda4c8d0a0ae6586fd0f1bfeefda32061799f3c..8012adcd4f9d211edf67911c826f2b61451d9bf3 100644 (file)
@@ -175,12 +175,12 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq,
 
        /* We block the internal cascade */
        if (hw == 2)
-               irq_to_desc(virq)->status |= IRQ_NOREQUEST;
+               irq_set_status_flags(virq, IRQ_NOREQUEST);
 
        /* We use the level handler only for now, we might want to
         * be more cautious here but that works for now
         */
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
        set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq);
        return 0;
 }
index bc61ebb8987c5f2b7d0650600fec9294c4693845..c43e9bcff9f0b4c3266d327b95274975fd60fc49 100644 (file)
@@ -213,7 +213,7 @@ static int mv64x60_host_map(struct irq_host *h, unsigned int virq,
 {
        int level1;
 
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
 
        level1 = (hwirq & MV64x60_LEVEL1_MASK) >> MV64x60_LEVEL1_OFFSET;
        BUG_ON(level1 > MV64x60_LEVEL1_GPP);
index 8c9ded8ea07c334d3bb4d949caa81274daadff64..6349a72dcfd4b08dd5909c9f8c14d86198c3a441 100644 (file)
@@ -268,7 +268,7 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
        chip = &qe_ic->hc_irq;
 
        set_irq_chip_data(virq, qe_ic);
-       irq_to_desc(virq)->status |= IRQ_LEVEL;
+       irq_set_status_flags(virq, IRQ_LEVEL);
 
        set_irq_chip_and_handler(virq, chip, handle_level_irq);
 
index 02c91db900374f065f443fb1bbbd01ebf3ab6f74..088413a7a42dc09bac1a0dbd06cb6f78e54317db 100644 (file)
@@ -391,7 +391,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
        DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
        if ((virq >= 1) && (virq <= 4)){
                irq = virq + IRQ_PCI_INTAD_BASE - 1;
-               irq_to_desc(irq)->status |= IRQ_LEVEL;
+               irq_set_status_flags(irq, IRQ_LEVEL);
                set_irq_chip(irq, &tsi108_pci_irq);
        }
        return 0;
index 835f7958b237c75bad59588e5ef5c8703c491358..a68469ef36d08c6e26697984df14a88a03b6bed8 100644 (file)
@@ -244,9 +244,9 @@ void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
 
 uic_irq_ret:
        raw_spin_lock(&desc->lock);
-       if (desc->status & IRQ_LEVEL)
+       if (irqd_is_level_type(&desc->irq_data))
                chip->irq_ack(&desc->irq_data);
-       if (!(desc->status & IRQ_DISABLED) && chip->irq_unmask)
+       if (!(irq_is_disabled(&desc->irq_data) && chip->irq_unmask)
                chip->irq_unmask(&desc->irq_data);
        raw_spin_unlock(&desc->lock);
 }