All of lore.kernel.org
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] of: introduce helper to manage boolean
Date: Thu, 15 Mar 2012 03:54:54 -0600	[thread overview]
Message-ID: <20120315095454.9294E3E08CB@localhost> (raw)
In-Reply-To: <1331660903-10193-1-git-send-email-plagnioj@jcrosoft.com>

On Tue, 13 Mar 2012 18:48:23 +0100, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> of_property_read_bool
> 
> Search for a property in a device node.
> Returns true if the property exist false otherwise.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>

One comment below; but otherwise:

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Feel free to merge via whatever tree needs it.

g.

> Cc: Grant Likely <grant.likely@secretlab.ca>
> ---
> v4:
> 
> 	send the right version
> 
> 	include Grant comment
> 
> 	Grant can I get the go please?
> 
> Best Regards,
> J.
>  include/linux/of.h |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index a75a831..a992cdf 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)
>  #define of_match_node(_matches, _node)	NULL
>  #endif /* CONFIG_OF */
>  
> +/**
> + * of_property_read_bool - Findfrom a property
> + * @np:		device node from which the property value is to be read.
> + * @propname:	name of the property to be searched.
> + *
> + * Search for a property in a device node.
> + * Returns true if the property exist false otherwise.
> + */
> +static inline bool of_property_read_bool(const struct device_node *np,
> +					 const char *propname)
> +{
> +	struct property *prop = of_find_property(np, propname, NULL);
> +
> +	return prop ? true : false;
> +}

Could simply be:
{
	return of_find_property(...) != NULL;
}


> +
>  static inline int of_property_read_u32(const struct device_node *np,
>  				       const char *propname,
>  				       u32 *out_value)
> -- 
> 1.7.7
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Jean-Christophe PLAGNIOL-VILLARD
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH v4] of: introduce helper to manage boolean
Date: Thu, 15 Mar 2012 03:54:54 -0600	[thread overview]
Message-ID: <20120315095454.9294E3E08CB@localhost> (raw)
In-Reply-To: <1331660903-10193-1-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>

On Tue, 13 Mar 2012 18:48:23 +0100, Jean-Christophe PLAGNIOL-VILLARD <plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org> wrote:
> of_property_read_bool
> 
> Search for a property in a device node.
> Returns true if the property exist false otherwise.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
> Acked-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

One comment below; but otherwise:

Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

Feel free to merge via whatever tree needs it.

g.

> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> ---
> v4:
> 
> 	send the right version
> 
> 	include Grant comment
> 
> 	Grant can I get the go please?
> 
> Best Regards,
> J.
>  include/linux/of.h |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index a75a831..a992cdf 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)
>  #define of_match_node(_matches, _node)	NULL
>  #endif /* CONFIG_OF */
>  
> +/**
> + * of_property_read_bool - Findfrom a property
> + * @np:		device node from which the property value is to be read.
> + * @propname:	name of the property to be searched.
> + *
> + * Search for a property in a device node.
> + * Returns true if the property exist false otherwise.
> + */
> +static inline bool of_property_read_bool(const struct device_node *np,
> +					 const char *propname)
> +{
> +	struct property *prop = of_find_property(np, propname, NULL);
> +
> +	return prop ? true : false;
> +}

Could simply be:
{
	return of_find_property(...) != NULL;
}


> +
>  static inline int of_property_read_u32(const struct device_node *np,
>  				       const char *propname,
>  				       u32 *out_value)
> -- 
> 1.7.7
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

  reply	other threads:[~2012-03-15  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 17:48 [PATCH v4] of: introduce helper to manage boolean Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 17:48 ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-15  9:54 ` Grant Likely [this message]
2012-03-15  9:54   ` Grant Likely
2012-03-15 14:18   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-15 14:18     ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120315095454.9294E3E08CB@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.