linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF
@ 2011-12-14 22:39 Jamie Iles
  2011-12-14 22:39 ` [PATCH 2/2] ARM: vic: always use simple ops Jamie Iles
  2011-12-14 22:45 ` [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles
  0 siblings, 2 replies; 3+ messages in thread
From: Jamie Iles @ 2011-12-14 22:39 UTC (permalink / raw)
  To: linux-arm-kernel

irqdomain support is used in interrupt controller drivers that may not
have device tree support but only need the basic HW->Linux irq
translation.  Rather than having each of these implement their own IRQ
domain, allow them to use the simple ops.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rob Herring <robherring2@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 include/linux/irqdomain.h |    3 ++-
 kernel/irq/irqdomain.c    |   12 +++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 99834e58..bd4272b 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -91,10 +91,11 @@ static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
 
 extern void irq_domain_add(struct irq_domain *domain);
 extern void irq_domain_del(struct irq_domain *domain);
+
+extern struct irq_domain_ops irq_domain_simple_ops;
 #endif /* CONFIG_IRQ_DOMAIN */
 
 #if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
-extern struct irq_domain_ops irq_domain_simple_ops;
 extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
 extern void irq_domain_generate_simple(const struct of_device_id *match,
 					u64 phys_base, unsigned int irq_start);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 200ce83..7ca523b 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -143,11 +143,6 @@ int irq_domain_simple_dt_translate(struct irq_domain *d,
 	return 0;
 }
 
-struct irq_domain_ops irq_domain_simple_ops = {
-	.dt_translate = irq_domain_simple_dt_translate,
-};
-EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
-
 /**
  * irq_domain_create_simple() - Set up a 'simple' translation range
  */
@@ -182,3 +177,10 @@ void irq_domain_generate_simple(const struct of_device_id *match,
 }
 EXPORT_SYMBOL_GPL(irq_domain_generate_simple);
 #endif /* CONFIG_OF_IRQ */
+
+struct irq_domain_ops irq_domain_simple_ops = {
+#ifdef CONFIG_OF_IRQ
+	.dt_translate = irq_domain_simple_dt_translate,
+#endif /* CONFIG_OF_IRQ */
+};
+EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ARM: vic: always use simple ops
  2011-12-14 22:39 [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles
@ 2011-12-14 22:39 ` Jamie Iles
  2011-12-14 22:45 ` [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles
  1 sibling, 0 replies; 3+ messages in thread
From: Jamie Iles @ 2011-12-14 22:39 UTC (permalink / raw)
  To: linux-arm-kernel

Now that irq_domain_simple_ops are available for non-DT users, use them
in the VIC driver so that we don't get a NULL dereference in
irq_domain_to_irq() when registering the domain.

Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Russell King <rmk+linux@arm.linux.org.uk>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 arch/arm/common/vic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 7728750..dcb004a 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -197,8 +197,8 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
 	v->domain.nr_irq = 32;
 #ifdef CONFIG_OF_IRQ
 	v->domain.of_node = of_node_get(node);
-	v->domain.ops = &irq_domain_simple_ops;
 #endif /* CONFIG_OF */
+	v->domain.ops = &irq_domain_simple_ops;
 	irq_domain_add(&v->domain);
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF
  2011-12-14 22:39 [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles
  2011-12-14 22:39 ` [PATCH 2/2] ARM: vic: always use simple ops Jamie Iles
@ 2011-12-14 22:45 ` Jamie Iles
  1 sibling, 0 replies; 3+ messages in thread
From: Jamie Iles @ 2011-12-14 22:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 14, 2011 at 10:39:57PM +0000, Jamie Iles wrote:
> irqdomain support is used in interrupt controller drivers that may not
> have device tree support but only need the basic HW->Linux irq
> translation.  Rather than having each of these implement their own IRQ
> domain, allow them to use the simple ops.
> 
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
> Acked-by: Rob Herring <robherring2@gmail.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

I've put these in the patch tracker as 723[56]/1 for expediency.

Jamie

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-14 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 22:39 [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles
2011-12-14 22:39 ` [PATCH 2/2] ARM: vic: always use simple ops Jamie Iles
2011-12-14 22:45 ` [PATCH 1/2] irqdomain: export irq_domain_simple_ops for !CONFIG_OF Jamie Iles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).