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, linux-devicetree, lkml
On Thu, Feb 16, 2012 at 2:09 AM, Grant Likely [off-list ref] w= rote:
This patch only moves the code. =A0It doesn't make any changes, and the code is still only compiled for powerpc. =A0Follow-on patches will genera=
lize
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, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_hw_number_t=
hwirq)
+{
+ =A0 =A0 =A0 unsigned int i;
+ =A0 =A0 =A0 unsigned int hint =3D hwirq % irq_virq_count;
+
+ =A0 =A0 =A0 /* Look for default host if nececssary */
+ =A0 =A0 =A0 if (host =3D=3D NULL)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 host =3D irq_default_host;
+ =A0 =A0 =A0 if (host =3D=3D NULL)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return NO_IRQ;
+
+ =A0 =A0 =A0 /* legacy -> bail early */
+ =A0 =A0 =A0 if (host->revmap_type =3D=3D IRQ_DOMAIN_MAP_LEGACY)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return hwirq;
+
+ =A0 =A0 =A0 /* Slow path does a linear search of the map */
+ =A0 =A0 =A0 if (hint =3D=3D 0)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 hint =3D 1;
+ =A0 =A0 =A0 i =3D hint;
+ =A0 =A0 =A0 do {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct irq_data *data =3D irq_get_irq_data(=i);
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (data && (data->domain =3D=3D host) && (=
data->hwirq =3D=3D hwirq))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return i; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 i++; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (i >=3D irq_virq_count) + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 i =3D 1
Typo on this line; missing semicolon. Fixed in my tree now. g.