diff mbox

dt: add 'const' for of_property_read_string parameter **out_string

Message ID 1309741278-26776-1-git-send-email-shawn.guo@linaro.org
State New
Headers show

Commit Message

Shawn Guo July 4, 2011, 1:01 a.m. UTC
The existing dt codes usually call of_get_property to get a string
property and save it as a 'const char *'.  The patch adds'const' for
of_property_read_string parameter **out_string to make the converting
of existing code a little easier.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/of/base.c  |    2 +-
 include/linux/of.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Grant Likely July 4, 2011, 5:47 a.m. UTC | #1
On Mon, Jul 04, 2011 at 09:01:18AM +0800, Shawn Guo wrote:
> The existing dt codes usually call of_get_property to get a string
> property and save it as a 'const char *'.  The patch adds'const' for
> of_property_read_string parameter **out_string to make the converting
> of existing code a little easier.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Applied, thanks.

g.

> ---
>  drivers/of/base.c  |    2 +-
>  include/linux/of.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index b8b65fd..57ec27b 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -639,7 +639,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32);
>   * The out_string pointer is modified only if a valid string can be decoded.
>   */
>  int of_property_read_string(struct device_node *np, char *propname,
> -				char **out_string)
> +				const char **out_string)
>  {
>  	struct property *prop = of_find_property(np, propname, NULL);
>  	if (!prop)
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 4fc4c1b..b238520 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -198,7 +198,7 @@ extern struct property *of_find_property(const struct device_node *np,
>  extern int of_property_read_u32(struct device_node *np, char *propname,
>  					u32 *out_value);
>  extern int of_property_read_string(struct device_node *np, char *propname,
> -					char **out_string);
> +					const char **out_string);
>  extern int of_device_is_compatible(const struct device_node *device,
>  				   const char *);
>  extern int of_device_is_available(const struct device_node *device);
> -- 
> 1.7.4.1
>
diff mbox

Patch

diff --git a/drivers/of/base.c b/drivers/of/base.c
index b8b65fd..57ec27b 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -639,7 +639,7 @@  EXPORT_SYMBOL_GPL(of_property_read_u32);
  * The out_string pointer is modified only if a valid string can be decoded.
  */
 int of_property_read_string(struct device_node *np, char *propname,
-				char **out_string)
+				const char **out_string)
 {
 	struct property *prop = of_find_property(np, propname, NULL);
 	if (!prop)
diff --git a/include/linux/of.h b/include/linux/of.h
index 4fc4c1b..b238520 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -198,7 +198,7 @@  extern struct property *of_find_property(const struct device_node *np,
 extern int of_property_read_u32(struct device_node *np, char *propname,
 					u32 *out_value);
 extern int of_property_read_string(struct device_node *np, char *propname,
-					char **out_string);
+					const char **out_string);
 extern int of_device_is_compatible(const struct device_node *device,
 				   const char *);
 extern int of_device_is_available(const struct device_node *device);