of/irq: Refactor interrupt-map parsing
authorGrant Likely <grant.likely@linaro.org>
Sun, 15 Sep 2013 21:32:39 +0000 (22:32 +0100)
committerGrant Likely <grant.likely@linaro.org>
Thu, 24 Oct 2013 10:43:04 +0000 (11:43 +0100)
commit2361613206e66ce59cc0e08efa8d98ec15b84ed1
tree5e4f5fc33f715202f71770890dcc09ac09a2d851
parente6d30ab1e7d1281784672c0fc2ffa385cfb7279e
of/irq: Refactor interrupt-map parsing

All the users of of_irq_parse_raw pass in a raw interrupt specifier from
the device tree and expect it to be returned (possibly modified) in an
of_phandle_args structure. However, the primary function of
of_irq_parse_raw() is to check for translations due to the presence of
one or more interrupt-map properties. The actual placing of the data
into an of_phandle_args structure is trivial. If it is refactored to
accept an of_phandle_args structure directly, then it becomes possible
to consume of_phandle_args from other sources. This is important for an
upcoming patch that allows a device to be connected to more than one
interrupt parent. It also simplifies the code a bit.

The biggest complication with this patch is that the old version works
on the interrupt specifiers in __be32 form, but the of_phandle_args
structure is intended to carry it in the cpu-native version. A bit of
churn was required to make this work. In the end it results in tighter
code, so the churn is worth it.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/fsl_uli1575.c
drivers/of/irq.c
drivers/of/of_pci_irq.c
include/linux/of_irq.h