Re: [PATCH v5 08/27] irq_domain: Move irq_domain code from powerpc to kernel/irq

From
Grant Likely <hidden>
Date
2012-02-16 13:24:11
Also in
linux-arm-kernel, linuxppc-dev, lkml
Reply to
Grant Likely, 2012-02-16
On Thu, Feb 16, 2012 at 2:09 AM, Grant Likely [off-list ref] wrote:
This patch only moves the code.  It doesn't make any changes, and the
code is still only compiled for powerpc.  Follow-on patches will generalize
the code for other architectures.

Signed-off-by: Grant Likely <redacted>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <redacted>
Cc: Milton Miller <redacted>
Tested-by: Olof Johansson <redacted>
---
+unsigned int irq_find_mapping(struct irq_domain *host,
+                             irq_hw_number_t hwirq)
+{
+       unsigned int i;
+       unsigned int hint = hwirq % irq_virq_count;
+
+       /* Look for default host if nececssary */
+       if (host == NULL)
+               host = irq_default_host;
+       if (host == NULL)
+               return NO_IRQ;
+
+       /* legacy -> bail early */
+       if (host->revmap_type == IRQ_DOMAIN_MAP_LEGACY)
+               return hwirq;
+
+       /* Slow path does a linear search of the map */
+       if (hint == 0)
+               hint = 1;
+       i = hint;
+       do {
+               struct irq_data *data = irq_get_irq_data(i);
+               if (data && (data->domain == host) && (data->hwirq == hwirq))
+                       return i;
+               i++;
+               if (i >= irq_virq_count)
+                       i = 1
Typo on this line; missing semicolon.  Fixed in my tree now.

g.
Thread (39 messages) 39 messages, 6 authors, last reply 2012-02-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help