diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-07-23 01:48:25 -0600 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-07-24 16:51:52 -0600 |
commit | 9a6b2e588c7809e86161236da3d29581bf5f8402 (patch) | |
tree | 0aebb8e868615a2354042a376405cd73d80ef19e /drivers/of/irq.c | |
parent | 883c2cfc8bcc0fd00c5d9f596fb8870f481b5bda (diff) | |
download | linux-9a6b2e588c7809e86161236da3d29581bf5f8402.tar.bz2 |
of: Fix phandle endian issues
The flat tree code wasn't fixing the endianness on phandle values when
unflattening the tree, and the code in drivers/of wasn't always doing a
be32_to_cpu before trying to dereference the phandle values. This patch
fixes them.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of/irq.c')
-rw-r--r-- | drivers/of/irq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 6cfb307204c3..65cfae1bd670 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -54,7 +54,7 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map); static struct device_node *of_irq_find_parent(struct device_node *child) { struct device_node *p; - const phandle *parp; + const __be32 *parp; if (!of_node_get(child)) return NULL; @@ -67,7 +67,7 @@ static struct device_node *of_irq_find_parent(struct device_node *child) if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) p = of_node_get(of_irq_dflt_pic); else - p = of_find_node_by_phandle(*parp); + p = of_find_node_by_phandle(be32_to_cpup(parp)); } of_node_put(child); child = p; @@ -206,7 +206,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) newpar = of_node_get(of_irq_dflt_pic); else - newpar = of_find_node_by_phandle((phandle)*imap); + newpar = of_find_node_by_phandle(be32_to_cpup(imap)); imap++; --imaplen; |