Skip to contentSkip to conversation

gpiolib: dump correct irq trigger type

PATCH In review Dmitry Baryshkov 2 participants 2 messages Aug 3, 2008 – Aug 14, 2008 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: dump correct irq trigger type

Use desc->action->flags for dumping irq flags, it is populated with correct trigger type.

---
 drivers/gpio/gpiolib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpio/gpiolib.c +2 -1
index beaf6b3..a35d19d 100644
@@ -2,6 +2,7 @@
 #include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
 
 #include <asm/gpio.h>
 
@@ -570,7 +571,7 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 			if (irq >= 0 && desc->action) {
 				char *trigger;
 
-				switch (desc->status & IRQ_TYPE_SENSE_MASK) {
+				switch (desc->action->flags & IRQ_TYPE_SENSE_MASK) {
 				case IRQ_TYPE_NONE:
 					trigger = "(default)";
 					break;
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 2 lines · Dmitry Baryshkov

Use desc->action->flags for dumping irq flags, it is populated with correct trigger type.

I'll NAK this ... the trigger type is actually a bit problematic, it hasn't previously been maintained *anywhere* except possibly as platform-specific code. And if it were maintained, desc->status would be the right place: the flags for each action would otherwise need to be updated.

However, given recent cleanups in handling of genirq triggering I think it's time for me to submit a patch to correct that little oversight.

- Dave

Quoted 30 lines
---
 drivers/gpio/gpiolib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpio/gpiolib.c +2 -1
index beaf6b3..a35d19d 100644
@@ -2,6 +2,7 @@
 #include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
 
 #include <asm/gpio.h>
 
@@ -570,7 +571,7 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 			if (irq >= 0 && desc->action) {
 				char *trigger;
 
-				switch (desc->status & IRQ_TYPE_SENSE_MASK) {
+				switch (desc->action->flags & IRQ_TYPE_SENSE_MASK) {
 				case IRQ_TYPE_NONE:
 					trigger = "(default)";
 					break;
Signature · 1 line
1.5.6.3