From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 3485067D56 for ; Sat, 28 Oct 2006 17:24:04 +1000 (EST) Subject: Re: Is get_property() correct? From: Benjamin Herrenschmidt To: Grant Likely In-Reply-To: <528646bc0610272341s3c655ebbn785b373f148f6174@mail.gmail.com> References: <528646bc0610272341s3c655ebbn785b373f148f6174@mail.gmail.com> Content-Type: text/plain Date: Sat, 28 Oct 2006 17:23:55 +1000 Message-Id: <1162020235.25682.124.camel@localhost.localdomain> Mime-Version: 1.0 Cc: "linuxppc-dev@ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. > > Does the comment or the code need to change? Well considering that we don't know the type of the property value, the best we can do is return a pointer to it ... The comment might want an update, though it never stroke me as confusing but heh :) > 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. >