Skip to contentSkip to conversation

Use functionality of irq_get_trigger_type() and

PATCH Applied Vasileios Amoiridis 3 participants 5 messages Sep 12, 2024 – Sep 13, 2024 Device tree

lore
Share & tools
lore
#0 lore raw

v4 cover Use functionality of irq_get_trigger_type() and

The series is compile tested.

Changes in v4:
- Use Elvis operator in patch no.2

---
v3: https://lore.kernel.org/linux-devicetree/[email protected]/

Changes in v3:
- Fix syntax error in patch no.2

---
v2: https://lore.kernel.org/linux-devicetree/[email protected]/

Changes in v2:
- Split patches to subsystems
- Use DEFINE_* helpers to define resources

---
v1: https://lore.kernel.org/all/[email protected]/

28/11/2024Vasileios Amoiridis (2):
of/irq: Make use of irq_get_trigger_type()
of/irq: Use helper to define resources

 drivers/of/irq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

base-commit: 32ffa5373540a8d1c06619f52d019c6cdc948bb4

Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/2 of/irq: Make use of irq_get_trigger_type()

Convert irqd_get_trigger_type(irq_get_irq_data(irq)) cases to the more simple irq_get_trigger_type(irq).

---
 drivers/of/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/irq.c +1 -1
index 36351ad6115e..5d27b20634d3 100644
@@ -430,7 +430,7 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
 					      &name);
 
 		r->start = r->end = irq;
-		r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
+		r->flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
 		r->name = name ? name : of_node_full_name(dev);
 	}
 

base-commit: 32ffa5373540a8d1c06619f52d019c6cdc948bb4

Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/2 of/irq: Use helper to define resources

In reply to Vasileios Amoiridis

Resources definition can become simpler and more organised by using the dedicated helpers.

---
 drivers/of/irq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/of/irq.c +2 -3
index 5d27b20634d3..a494f56a0d0e 100644
@@ -429,9 +429,8 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
 		of_property_read_string_index(dev, "interrupt-names", index,
 					      &name);
 
-		r->start = r->end = irq;
-		r->flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
-		r->name = name ? name : of_node_full_name(dev);
+		*r = DEFINE_RES_IRQ_NAMED(irq, name ?: of_node_full_name(dev));
+		r->flags |= irq_get_trigger_type(irq);
 	}
 
 	return irq;
Signature · 1 line
2.25.1
maintainer Applied
#4 lore raw
In reply to Vasileios Amoiridis
Quoted 25 lines · Vasileios Amoiridis

The series is compile tested.

Changes in v4:
- Use Elvis operator in patch no.2

---
v3: https://lore.kernel.org/linux-devicetree/[email protected]/

Changes in v3:
- Fix syntax error in patch no.2

---
v2: https://lore.kernel.org/linux-devicetree/[email protected]/

Changes in v2:
- Split patches to subsystems
- Use DEFINE_* helpers to define resources

---
v1: https://lore.kernel.org/all/[email protected]/

28/11/2024Vasileios Amoiridis (2):
of/irq: Make use of irq_get_trigger_type()
of/irq: Use helper to define resources

Quoted 10 lines
 drivers/of/irq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

base-commit: 32ffa5373540a8d1c06619f52d019c6cdc948bb4 --
2.25.1

Applied, thanks!