diff options
author | Grant Likely <grant.likely@linaro.org> | 2013-09-15 17:32:39 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-10-24 06:43:04 -0400 |
commit | 2361613206e66ce59cc0e08efa8d98ec15b84ed1 (patch) | |
tree | 5e4f5fc33f715202f71770890dcc09ac09a2d851 /arch/powerpc/platforms/fsl_uli1575.c | |
parent | e6d30ab1e7d1281784672c0fc2ffa385cfb7279e (diff) |
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>
Diffstat (limited to 'arch/powerpc/platforms/fsl_uli1575.c')
-rw-r--r-- | arch/powerpc/platforms/fsl_uli1575.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 8904046556ad..b97f6f3d3c5b 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c | |||
@@ -322,7 +322,6 @@ static void hpcd_final_uli5288(struct pci_dev *dev) | |||
322 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 322 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |
323 | struct device_node *hosenode = hose ? hose->dn : NULL; | 323 | struct device_node *hosenode = hose ? hose->dn : NULL; |
324 | struct of_phandle_args oirq; | 324 | struct of_phandle_args oirq; |
325 | int pin = 2; | ||
326 | u32 laddr[3]; | 325 | u32 laddr[3]; |
327 | 326 | ||
328 | if (!machine_is(mpc86xx_hpcd)) | 327 | if (!machine_is(mpc86xx_hpcd)) |
@@ -331,9 +330,12 @@ static void hpcd_final_uli5288(struct pci_dev *dev) | |||
331 | if (!hosenode) | 330 | if (!hosenode) |
332 | return; | 331 | return; |
333 | 332 | ||
333 | oirq.np = hosenode; | ||
334 | oirq.args[0] = 2; | ||
335 | oirq.args_count = 1; | ||
334 | laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8); | 336 | laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8); |
335 | laddr[1] = laddr[2] = 0; | 337 | laddr[1] = laddr[2] = 0; |
336 | of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq); | 338 | of_irq_parse_raw(laddr, &oirq); |
337 | dev->irq = irq_create_of_mapping(&oirq); | 339 | dev->irq = irq_create_of_mapping(&oirq); |
338 | } | 340 | } |
339 | 341 | ||