From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: LAK <linux-arm-kernel@lists.infradead.org>,
Russell King <linux@arm.linux.org.uk>,
Lennert Buytenhek <buytenh@wantstofly.org>
Subject: [patch 06/23] arm: Cleanup irq_desc access
Date: Fri, 25 Mar 2011 13:21:56 -0000 [thread overview]
Message-ID: <20110325132047.940493428@linutronix.de> (raw)
In-Reply-To: 20110325131617.258789658@linutronix.de
[-- Attachment #1: arm-orion.patch --]
[-- Type: text/plain, Size: 3970 bytes --]
Use the proper wrappers and use the flow type in irq_data.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/arm/plat-orion/gpio.c | 25 ++++++++++---------------
arch/arm/plat-orion/irq.c | 2 +-
2 files changed, 11 insertions(+), 16 deletions(-)
Index: linux-2.6-tip/arch/arm/plat-orion/gpio.c
===================================================================
--- linux-2.6-tip.orig/arch/arm/plat-orion/gpio.c
+++ linux-2.6-tip/arch/arm/plat-orion/gpio.c
@@ -324,9 +324,8 @@ EXPORT_SYMBOL(orion_gpio_set_blink);
static void gpio_irq_ack(struct irq_data *d)
{
struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
- int type;
+ int type = irqd_get_trigger_type(d);
- type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
int pin = d->irq - ochip->secondary_irq_base;
@@ -337,11 +336,10 @@ static void gpio_irq_ack(struct irq_data
static void gpio_irq_mask(struct irq_data *d)
{
struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
- int type;
+ int type = irqd_get_trigger_type(d);
void __iomem *reg;
int pin;
- type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
reg = GPIO_EDGE_MASK(ochip);
else
@@ -355,11 +353,10 @@ static void gpio_irq_mask(struct irq_dat
static void gpio_irq_unmask(struct irq_data *d)
{
struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
- int type;
+ int type = irqd_get_trigger_type(d);
void __iomem *reg;
int pin;
- type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
reg = GPIO_EDGE_MASK(ochip);
else
@@ -389,9 +386,9 @@ static int gpio_irq_set_type(struct irq_
* Set edge/level type.
*/
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
- set_irq_handler(d->irq, handle_edge_irq);
+ __irq_set_handler_locked(d->irq, handle_edge_irq);
} else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
- set_irq_handler(d->irq, handle_level_irq);
+ __irq_set_handler_locked(d->irq, handle_level_irq);
} else {
printk(KERN_ERR "failed to set irq=%d (type=%d)\n",
d->irq, type);
@@ -480,7 +477,7 @@ void __init orion_gpio_init(int gpio_bas
set_irq_chip(irq, &orion_gpio_irq_chip);
set_irq_handler(irq, handle_level_irq);
set_irq_chip_data(irq, ochip);
- irq_desc[irq].status |= IRQ_LEVEL;
+ irq_set_status_flags(irq, IRQ_LEVEL);
set_irq_flags(irq, IRQF_VALID);
}
}
@@ -488,7 +485,7 @@ void __init orion_gpio_init(int gpio_bas
void orion_gpio_irq_handler(int pinoff)
{
struct orion_gpio_chip *ochip;
- u32 cause;
+ u32 cause, type;
int i;
ochip = orion_gpio_chip_find(pinoff);
@@ -500,15 +497,14 @@ void orion_gpio_irq_handler(int pinoff)
for (i = 0; i < ochip->chip.ngpio; i++) {
int irq;
- struct irq_desc *desc;
irq = ochip->secondary_irq_base + i;
if (!(cause & (1 << i)))
continue;
- desc = irq_desc + irq;
- if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
+ type = irqd_get_trigger_type(irq_get_irq_data(irq));
+ if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
/* Swap polarity (race with GPIO line) */
u32 polarity;
@@ -516,7 +512,6 @@ void orion_gpio_irq_handler(int pinoff)
polarity ^= 1 << i;
writel(polarity, GPIO_IN_POL(ochip));
}
-
- desc_handle_irq(irq, desc);
+ generic_handle_irq(irq);
}
}
Index: linux-2.6-tip/arch/arm/plat-orion/irq.c
===================================================================
--- linux-2.6-tip.orig/arch/arm/plat-orion/irq.c
+++ linux-2.6-tip/arch/arm/plat-orion/irq.c
@@ -59,7 +59,7 @@ void __init orion_irq_init(unsigned int
set_irq_chip(irq, &orion_irq_chip);
set_irq_chip_data(irq, maskaddr);
set_irq_handler(irq, handle_level_irq);
- irq_desc[irq].status |= IRQ_LEVEL;
+ irq_set_status_flags(irq, IRQ_LEVEL);
set_irq_flags(irq, IRQF_VALID);
}
}
next prev parent reply other threads:[~2011-03-25 13:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 13:21 [patch 00/23] ARM: Final genirq cleanup Thomas Gleixner
2011-03-25 13:21 ` [patch 01/23] arm: Ns9xxx: Remove private irq flow handler Thomas Gleixner
2011-03-25 13:21 ` [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc Thomas Gleixner
2011-03-26 20:12 ` Varun Wadekar
2011-03-26 20:24 ` Thomas Gleixner
2011-03-26 22:37 ` Colin Cross
2011-03-27 8:07 ` Thomas Gleixner
2011-03-25 13:21 ` [patch 03/23] arm: Use genirq lockdep helper to set lock class Thomas Gleixner
2011-03-25 13:21 ` [patch 04/23] arm: Use irq flag setter function Thomas Gleixner
2011-03-25 13:21 ` [patch 05/23] arm: msm: Convert to new irq chip functions Thomas Gleixner
2011-03-25 13:21 ` Thomas Gleixner [this message]
2011-03-25 13:21 ` [patch 07/23] arm: plat-samsung: Use proper irq accessor functions Thomas Gleixner
2011-03-25 13:21 ` [patch 08/23] arm: stmp3xxx: Use generic_handle_irq() Thomas Gleixner
2011-03-25 13:21 ` [patch 09/23] arm: nomadik: Use local irq state Thomas Gleixner
2011-03-25 13:22 ` [patch 10/23] arm: plat-omap: Cleanup irq_desc access Thomas Gleixner
2011-03-25 13:22 ` [patch 11/23] arm: msm: Use proper irq accessor functions Thomas Gleixner
2011-03-25 13:22 ` [patch 12/23] arm: vt8500: Use proper irq accessors Thomas Gleixner
2011-03-25 13:22 ` [patch 13/23] arm: mxc: Use generic_handle_irq() Thomas Gleixner
2011-03-25 13:22 ` [patch 14/23] arm: gemini: Use proper irq accessor functions Thomas Gleixner
2011-03-25 13:22 ` [patch 15/23] arm: ep93xx: " Thomas Gleixner
2011-03-25 13:22 ` [patch 16/23] arm: davinci: Cleanup irq chip code Thomas Gleixner
2011-03-25 13:22 ` [patch 17/23] arm: at91: Cleanup irq chip Thomas Gleixner
2011-03-25 21:03 ` Thomas Gleixner
2011-03-27 15:02 ` Sergei Shtylyov
2011-03-27 15:47 ` Thomas Gleixner
2011-03-25 13:22 ` [patch 18/23] arm: gic: Use proper accessor functions Thomas Gleixner
2011-03-25 13:22 ` [patch 19/23] arm: dove: Use proper irq " Thomas Gleixner
2011-03-25 13:22 ` [patch 20/23] arm: Use generic show_interrupts() Thomas Gleixner
2011-03-25 13:22 ` [patch 21/23] arm: Cleanup the irq namespace Thomas Gleixner
2011-04-18 17:43 ` H Hartley Sweeten
2011-03-25 13:22 ` [patch 22/23] arm: Reorder irq_set_ function calls Thomas Gleixner
2011-03-25 13:22 ` [patch 23/23] arm: Fold irq_set_chip/irq_set_handler Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110325132047.940493428@linutronix.de \
--to=tglx@linutronix.de \
--cc=buytenh@wantstofly.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox