Is get_property() correct?

Grant Likely grant.likely at secretlab.ca
Sat Oct 28 16:41:59 EST 2006


Is the implementation of get_property correct?  The comment says it
returns the value of a property; but the return statement just returns
the property pointer (cast as void*) it got from of_find_property();
not the value.

Does the comment or the code need to change?

in prom.c:

/*
 * Find a property with a given name for a given node
 * and return the value.
 */
const void *get_property(const struct device_node *np, const char *name,
                         int *lenp)
{
        struct property *pp = of_find_property(np,name,lenp);
        return pp ? pp->value : NULL;
}
EXPORT_SYMBOL(get_property);

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195



More information about the Linuxppc-dev mailing list