2013-06-14 16:41:01

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 0/7] genirq: add irq_get_trigger_type() to get IRQ flags

Drivers that want to get the trigger edge/level type flags for a
given interrupt have to first call irq_get_irq_data(irq) to get
the struct irq_data and then irqd_get_trigger_type(irq_data) to
obtain the IRQ flags.

This is not only error prone but also unnecessary exposes the
struct irq_data to callers. This patch-set adds a new function
irq_get_trigger_type() to obtain the edge/level flags for an IRQ
and updates the places where irq_get_irq_data(irq) was called
just to obtain the flags from the struct irq_data.

The patch-set is composed of the following patches:

[PATCH 1/7] genirq: add irq_get_trigger_type() to get IRQ flags
[PATCH 2/7] gpio: mvebu: use irq_get_trigger_type() to get IRQ flags
[PATCH 3/7] mfd: twl4030-irq: use irq_get_trigger_type() to get IRQ flags
[PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags
[PATCH 5/7] arm: orion: use irq_get_trigger_type() to get IRQ flags
[PATCH 6/7] MIPS: octeon: use irq_get_trigger_type() to get IRQ flags
[PATCH 7/7] irqdomain: use irq_get_trigger_type() to get IRQ flags

arch/arm/plat-orion/gpio.c | 2 +-
arch/mips/cavium-octeon/octeon-irq.c | 2 +-
drivers/gpio/gpio-mvebu.c | 2 +-
drivers/mfd/stmpe.c | 3 +--
drivers/mfd/twl4030-irq.c | 5 +----
include/linux/irq.h | 6 ++++++
kernel/irq/irqdomain.c | 2 +-
7 files changed, 12 insertions(+), 10 deletions(-)

Best regards,
Javier


2013-06-14 16:41:06

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 1/7] genirq: add irq_get_trigger_type() to get IRQ flags

Drivers that want to get the trigger edge/level type flags for a
given interrupt have to first call irq_get_irq_data(irq) to get
the struct irq_data and then irqd_get_trigger_type(irq_data) to
obtain the IRQ flags.

This is not only error prone but also unnecessary exposes the
struct irq_data to callers.

It's better to have an irq_get_trigger_type() function to obtain
the edge/level flags for an IRQ.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
include/linux/irq.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index bc4e066..0e8e3a6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -579,6 +579,12 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
return d->msi_desc;
}

+static inline u32 irq_get_trigger_type(unsigned int irq)
+{
+ struct irq_data *d = irq_get_irq_data(irq);
+ return d ? irqd_get_trigger_type(d) : 0;
+}
+
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
struct module *owner);

--
1.7.7.6

2013-06-14 16:41:13

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 6/7] MIPS: octeon: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_desc_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
arch/mips/cavium-octeon/octeon-irq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index a22f06a..7181def 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -607,7 +607,7 @@ static void octeon_irq_ciu_gpio_ack(struct irq_data *data)

static void octeon_irq_handle_gpio(unsigned int irq, struct irq_desc *desc)
{
- if (irqd_get_trigger_type(irq_desc_get_irq_data(desc)) & IRQ_TYPE_EDGE_BOTH)
+ if (irq_get_trigger_type(irq) & IRQ_TYPE_EDGE_BOTH)
handle_edge_irq(irq, desc);
else
handle_level_irq(irq, desc);
--
1.7.7.6

2013-06-14 16:41:09

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
drivers/mfd/stmpe.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index bbccd51..5d5e6f9 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1208,8 +1208,7 @@ int stmpe_probe(struct stmpe_client_info *ci, int partnum)
}
stmpe->variant = stmpe_noirq_variant_info[stmpe->partnum];
} else if (pdata->irq_trigger == IRQF_TRIGGER_NONE) {
- pdata->irq_trigger =
- irqd_get_trigger_type(irq_get_irq_data(stmpe->irq));
+ pdata->irq_trigger = irq_get_trigger_type(stmpe->irq);
}

ret = stmpe_chip_init(stmpe);
--
1.7.7.6

2013-06-14 16:41:28

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 7/7] irqdomain: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_desc_get_irq_data(virq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
kernel/irq/irqdomain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 54a4d522..ff3eebb 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -698,7 +698,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller,

/* Set type if specified and different than the current one */
if (type != IRQ_TYPE_NONE &&
- type != (irqd_get_trigger_type(irq_get_irq_data(virq))))
+ type != irq_get_trigger_type(virq))
irq_set_irq_type(virq, type);
return virq;
}
--
1.7.7.6

2013-06-14 16:42:17

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 5/7] arm: orion: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
arch/arm/plat-orion/gpio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 249fe63..6816192 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -426,7 +426,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
if (!(cause & (1 << i)))
continue;

- type = irqd_get_trigger_type(irq_get_irq_data(irq));
+ type = irq_get_trigger_type(irq);
if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
/* Swap polarity (race with GPIO line) */
u32 polarity;
--
1.7.7.6

2013-06-14 16:42:51

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 3/7] mfd: twl4030-irq: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
drivers/mfd/twl4030-irq.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index a5f9888..9d2d1ba 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -537,16 +537,13 @@ static void twl4030_sih_bus_sync_unlock(struct irq_data *data)
/* Modify only the bits we know must change */
while (edge_change) {
int i = fls(edge_change) - 1;
- struct irq_data *idata;
int byte = i >> 2;
int off = (i & 0x3) * 2;
unsigned int type;

- idata = irq_get_irq_data(i + agent->irq_base);
-
bytes[byte] &= ~(0x03 << off);

- type = irqd_get_trigger_type(idata);
+ type = irq_get_trigger_type(i + agent->irq_base);
if (type & IRQ_TYPE_EDGE_RISING)
bytes[byte] |= BIT(off + 1);
if (type & IRQ_TYPE_EDGE_FALLING)
--
1.7.7.6

2013-06-14 16:43:15

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 2/7] gpio: mvebu: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
---
drivers/gpio/gpio-mvebu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 3a4816a..80ad35e 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -457,7 +457,7 @@ static void mvebu_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
if (!(cause & (1 << i)))
continue;

- type = irqd_get_trigger_type(irq_get_irq_data(irq));
+ type = irq_get_trigger_type(irq);
if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
/* Swap polarity (race with GPIO line) */
u32 polarity;
--
1.7.7.6

2013-06-14 17:20:53

by David Daney

[permalink] [raw]
Subject: Re: [PATCH 6/7] MIPS: octeon: use irq_get_trigger_type() to get IRQ flags

On 06/14/2013 09:40 AM, Javier Martinez Canillas wrote:
> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_desc_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Acked-by: David Daney <[email protected]>

> ---
> arch/mips/cavium-octeon/octeon-irq.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
> index a22f06a..7181def 100644
> --- a/arch/mips/cavium-octeon/octeon-irq.c
> +++ b/arch/mips/cavium-octeon/octeon-irq.c
> @@ -607,7 +607,7 @@ static void octeon_irq_ciu_gpio_ack(struct irq_data *data)
>
> static void octeon_irq_handle_gpio(unsigned int irq, struct irq_desc *desc)
> {
> - if (irqd_get_trigger_type(irq_desc_get_irq_data(desc)) & IRQ_TYPE_EDGE_BOTH)
> + if (irq_get_trigger_type(irq) & IRQ_TYPE_EDGE_BOTH)
> handle_edge_irq(irq, desc);
> else
> handle_level_irq(irq, desc);
>

2013-06-14 18:38:31

by Jason Cooper

[permalink] [raw]
Subject: Re: [PATCH 2/7] gpio: mvebu: use irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 06:40:44PM +0200, Javier Martinez Canillas wrote:
> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
> drivers/gpio/gpio-mvebu.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Jason Cooper <[email protected]>

thx,

Jason.

2013-06-14 18:38:56

by Jason Cooper

[permalink] [raw]
Subject: Re: [PATCH 5/7] arm: orion: use irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 06:40:47PM +0200, Javier Martinez Canillas wrote:
> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
> arch/arm/plat-orion/gpio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Jason Cooper <[email protected]>

thx,

Jason.

2013-06-17 09:20:59

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 6:40 PM, Javier Martinez Canillas
<[email protected]> wrote:

> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Acked-by: Linus Walleij <[email protected]>

If you get the other patches ACKed.

Yours,
Linus Walleij

2013-06-17 22:29:37

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH 0/7] genirq: add irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 5:40 PM, Javier Martinez Canillas
<[email protected]> wrote:
> Drivers that want to get the trigger edge/level type flags for a
> given interrupt have to first call irq_get_irq_data(irq) to get
> the struct irq_data and then irqd_get_trigger_type(irq_data) to
> obtain the IRQ flags.
>
> This is not only error prone but also unnecessary exposes the
> struct irq_data to callers. This patch-set adds a new function
> irq_get_trigger_type() to obtain the edge/level flags for an IRQ
> and updates the places where irq_get_irq_data(irq) was called
> just to obtain the flags from the struct irq_data.
>
> The patch-set is composed of the following patches:
>
> [PATCH 1/7] genirq: add irq_get_trigger_type() to get IRQ flags
> [PATCH 2/7] gpio: mvebu: use irq_get_trigger_type() to get IRQ flags
> [PATCH 3/7] mfd: twl4030-irq: use irq_get_trigger_type() to get IRQ flags
> [PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags
> [PATCH 5/7] arm: orion: use irq_get_trigger_type() to get IRQ flags
> [PATCH 6/7] MIPS: octeon: use irq_get_trigger_type() to get IRQ flags
> [PATCH 7/7] irqdomain: use irq_get_trigger_type() to get IRQ flags

For the whole series:
Acked-by: Grant Likely <[email protected]>

>
> arch/arm/plat-orion/gpio.c | 2 +-
> arch/mips/cavium-octeon/octeon-irq.c | 2 +-
> drivers/gpio/gpio-mvebu.c | 2 +-
> drivers/mfd/stmpe.c | 3 +--
> drivers/mfd/twl4030-irq.c | 5 +----
> include/linux/irq.h | 6 ++++++
> kernel/irq/irqdomain.c | 2 +-
> 7 files changed, 12 insertions(+), 10 deletions(-)
>
> Best regards,
> Javier

2013-06-18 08:46:50

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 06:40:46PM +0200, Javier Martinez Canillas wrote:
> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/

2013-06-18 08:47:16

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 3/7] mfd: twl4030-irq: use irq_get_trigger_type() to get IRQ flags

On Fri, Jun 14, 2013 at 06:40:45PM +0200, Javier Martinez Canillas wrote:
> Use irq_get_trigger_type() to get the IRQ trigger type flags
> instead calling irqd_get_trigger_type(irq_get_irq_data(irq))
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/

2013-06-25 07:11:42

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 0/7] genirq: add irq_get_trigger_type() to get IRQ flags

On 06/18/2013 12:29 AM, Grant Likely wrote:
> On Fri, Jun 14, 2013 at 5:40 PM, Javier Martinez Canillas
> <[email protected]> wrote:
>> Drivers that want to get the trigger edge/level type flags for a
>> given interrupt have to first call irq_get_irq_data(irq) to get
>> the struct irq_data and then irqd_get_trigger_type(irq_data) to
>> obtain the IRQ flags.
>>
>> This is not only error prone but also unnecessary exposes the
>> struct irq_data to callers. This patch-set adds a new function
>> irq_get_trigger_type() to obtain the edge/level flags for an IRQ
>> and updates the places where irq_get_irq_data(irq) was called
>> just to obtain the flags from the struct irq_data.
>>
>> The patch-set is composed of the following patches:
>>
>> [PATCH 1/7] genirq: add irq_get_trigger_type() to get IRQ flags
>> [PATCH 2/7] gpio: mvebu: use irq_get_trigger_type() to get IRQ flags
>> [PATCH 3/7] mfd: twl4030-irq: use irq_get_trigger_type() to get IRQ flags
>> [PATCH 4/7] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags
>> [PATCH 5/7] arm: orion: use irq_get_trigger_type() to get IRQ flags
>> [PATCH 6/7] MIPS: octeon: use irq_get_trigger_type() to get IRQ flags
>> [PATCH 7/7] irqdomain: use irq_get_trigger_type() to get IRQ flags
>
> For the whole series:
> Acked-by: Grant Likely <[email protected]>
>

Hello Thomas,

Do you have any comments on this patch-set?

It has been ack'ed by a lot of people so I wonder if you could take it.

Thanks a lot and best regards,
Javier

Subject: [tip:irq/core] mfd: stmpe: use irq_get_trigger_type() to get IRQ flags

Commit-ID: 1a5595cb288411840298f25dc3d8944a90e4b5ab
Gitweb: http://git.kernel.org/tip/1a5595cb288411840298f25dc3d8944a90e4b5ab
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:46 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

mfd: stmpe: use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Grant Likely <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-5-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/mfd/stmpe.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index bbccd51..5d5e6f9 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1208,8 +1208,7 @@ int stmpe_probe(struct stmpe_client_info *ci, int partnum)
}
stmpe->variant = stmpe_noirq_variant_info[stmpe->partnum];
} else if (pdata->irq_trigger == IRQF_TRIGGER_NONE) {
- pdata->irq_trigger =
- irqd_get_trigger_type(irq_get_irq_data(stmpe->irq));
+ pdata->irq_trigger = irq_get_trigger_type(stmpe->irq);
}

ret = stmpe_chip_init(stmpe);

Subject: [tip:irq/core] arm: orion: Use irq_get_trigger_type() to get IRQ flags

Commit-ID: f88704c95b5a2634eff99e2d720031555c67fe81
Gitweb: http://git.kernel.org/tip/f88704c95b5a2634eff99e2d720031555c67fe81
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:47 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

arm: orion: Use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-6-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/arm/plat-orion/gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 249fe63..6816192 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -426,7 +426,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
if (!(cause & (1 << i)))
continue;

- type = irqd_get_trigger_type(irq_get_irq_data(irq));
+ type = irq_get_trigger_type(irq);
if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
/* Swap polarity (race with GPIO line) */
u32 polarity;

Subject: [tip:irq/core] MIPS: octeon: Use irq_get_trigger_type() to get IRQ flags

Commit-ID: 5ebf1f29e20de9b37937f808dc2ac8dd15311450
Gitweb: http://git.kernel.org/tip/5ebf1f29e20de9b37937f808dc2ac8dd15311450
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:48 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

MIPS: octeon: Use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_desc_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: David Daney <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-7-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/mips/cavium-octeon/octeon-irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index a22f06a..7181def 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -607,7 +607,7 @@ static void octeon_irq_ciu_gpio_ack(struct irq_data *data)

static void octeon_irq_handle_gpio(unsigned int irq, struct irq_desc *desc)
{
- if (irqd_get_trigger_type(irq_desc_get_irq_data(desc)) & IRQ_TYPE_EDGE_BOTH)
+ if (irq_get_trigger_type(irq) & IRQ_TYPE_EDGE_BOTH)
handle_edge_irq(irq, desc);
else
handle_level_irq(irq, desc);

Subject: [tip:irq/core] irqdomain: Use irq_get_trigger_type() to get IRQ flags

Commit-ID: fbab62c5cd57a6acd9ed80903532c86897d2d560
Gitweb: http://git.kernel.org/tip/fbab62c5cd57a6acd9ed80903532c86897d2d560
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:49 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

irqdomain: Use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_desc_get_irq_data(virq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-8-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
kernel/irq/irqdomain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1db9e70..489921e 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -687,7 +687,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller,

/* Set type if specified and different than the current one */
if (type != IRQ_TYPE_NONE &&
- type != (irqd_get_trigger_type(irq_get_irq_data(virq))))
+ type != irq_get_trigger_type(virq))
irq_set_irq_type(virq, type);
return virq;
}

Subject: [tip:irq/core] mfd: twl4030-irq: Use irq_get_trigger_type() to get IRQ flags

Commit-ID: 5dbf79d496f3a9ad141dfd1ce4a9c4d7e12c9e2c
Gitweb: http://git.kernel.org/tip/5dbf79d496f3a9ad141dfd1ce4a9c4d7e12c9e2c
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:45 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

mfd: twl4030-irq: Use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-4-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/mfd/twl4030-irq.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index a5f9888..9d2d1ba 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -537,16 +537,13 @@ static void twl4030_sih_bus_sync_unlock(struct irq_data *data)
/* Modify only the bits we know must change */
while (edge_change) {
int i = fls(edge_change) - 1;
- struct irq_data *idata;
int byte = i >> 2;
int off = (i & 0x3) * 2;
unsigned int type;

- idata = irq_get_irq_data(i + agent->irq_base);
-
bytes[byte] &= ~(0x03 << off);

- type = irqd_get_trigger_type(idata);
+ type = irq_get_trigger_type(i + agent->irq_base);
if (type & IRQ_TYPE_EDGE_RISING)
bytes[byte] |= BIT(off + 1);
if (type & IRQ_TYPE_EDGE_FALLING)

Subject: [tip:irq/core] genirq: Add irq_get_trigger_type() to get IRQ flags

Commit-ID: 1f6236bfd7c38d5f9f7648fae7215e65274b9e63
Gitweb: http://git.kernel.org/tip/1f6236bfd7c38d5f9f7648fae7215e65274b9e63
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:43 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:24 +0200

genirq: Add irq_get_trigger_type() to get IRQ flags

Drivers that want to get the trigger edge/level type flags for a given
interrupt have to call irq_get_irq_data(irq) to get the struct
irq_data and then irqd_get_trigger_type(irq_data) to obtain the IRQ
flags.

This is not only error prone but also unnecessary exposes the struct
irq_data to callers.

It's better to have an irq_get_trigger_type() function to obtain the
edge/level flags for an IRQ.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-2-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
include/linux/irq.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 298a9b9..f04d3ba 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -584,6 +584,12 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
return d->msi_desc;
}

+static inline u32 irq_get_trigger_type(unsigned int irq)
+{
+ struct irq_data *d = irq_get_irq_data(irq);
+ return d ? irqd_get_trigger_type(d) : 0;
+}
+
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
struct module *owner);

Subject: [tip:irq/core] gpio: mvebu: Use irq_get_trigger_type() to get IRQ flags

Commit-ID: fb90c22ab5e926bd35526f197097793cf479b254
Gitweb: http://git.kernel.org/tip/fb90c22ab5e926bd35526f197097793cf479b254
Author: Javier Martinez Canillas <[email protected]>
AuthorDate: Fri, 14 Jun 2013 18:40:44 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Tue, 25 Jun 2013 11:48:25 +0200

gpio: mvebu: Use irq_get_trigger_type() to get IRQ flags

Use irq_get_trigger_type() to get the IRQ trigger type flags
instead calling irqd_get_trigger_type(irq_get_irq_data(irq))

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Grant Likely <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1371228049-27080-3-git-send-email-javier.martinez@collabora.co.uk
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/gpio/gpio-mvebu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 3a4816a..80ad35e 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -457,7 +457,7 @@ static void mvebu_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
if (!(cause & (1 << i)))
continue;

- type = irqd_get_trigger_type(irq_get_irq_data(irq));
+ type = irq_get_trigger_type(irq);
if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
/* Swap polarity (race with GPIO line) */
u32 polarity;