Subject: Re: Is get_property() correct?

From: Michael Ellerman <[email-masked]>
Date: Sat, 28 Oct 2006 16:53:20 +1000

On Sat, 2006-10-28 at 00:41 -0600, Grant Likely wrote:
> 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.

Minor correction, it returns the property->value pointer as a void *.

> Does the comment or the code need to change?

I don't think so. get_property() can't return the actual value because
it doesn't know what type it is, so it returns a void pointer to the
value and it's up to the caller to interpret it based on the callers
knowledge of what it's expecting, and/or the lenp.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person