Hi Grant,<br><br><div class="gmail_quote">On 1 July 2011 20:07, Grant Likely <span dir="ltr"><<a href="mailto:grant.likely@secretlab.ca">grant.likely@secretlab.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Fri, Jul 1, 2011 at 7:55 AM, Manjunatha GK <<a href="mailto:manjugk@ti.com">manjugk@ti.com</a>> wrote:<br>
> Use helper function of_property_read_u32() in place of of_get_property<br>
> and be32_to_cpup() api's for code optimization.<br>
><br>
> Compile tested the changes.<br>
><br>
> Signed-off-by: G, Manjunath Kondaiah <<a href="mailto:manjugk@ti.com">manjugk@ti.com</a>><br>
> ---<br>
> drivers/of/irq.c | 37 ++++++++++++++++++++++---------------<br>
> drivers/of/of_i2c.c | 8 +++-----<br>
> drivers/of/of_mdio.c | 16 ++++++----------<br>
> 3 files changed, 31 insertions(+), 30 deletions(-)<br>
><br>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c<br>
> index 9f689f1..13c02e2 100644<br>
> --- a/drivers/of/irq.c<br>
> +++ b/drivers/of/irq.c<br>
> @@ -59,20 +59,20 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);<br>
> struct device_node *of_irq_find_parent(struct device_node *child)<br>
> {<br>
> struct device_node *p;<br>
> - const __be32 *parp;<br>
> + u32 *parp = NULL;<br>
><br>
> if (!of_node_get(child))<br>
> return NULL;<br>
><br>
> do {<br>
> - parp = of_get_property(child, "interrupt-parent", NULL);<br>
> + of_property_read_u32(child, "interrupt-parent", parp);<br>
> if (parp == NULL)<br>
> p = of_get_parent(child);<br>
<br>
</div></div>Hi Manjunatha.<br>
<br>
This won't work. You must pass a valid pointer. It needs to be done this way;<br>
u32 parp;<br>
if (of_property_read_u32(child, "interrupt-parent", &parp) == 0) {<br>
...<br>
} else {<br>
...<br>
<div><div></div><div class="h5"> }<br></div></div></blockquote><div>Thanks for the quick catch. I will fix it.<br><br>-Manjunath <br>
</div></div><br>