From: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: [PATCH] dt: add 'const' for of_property_read_string parameter **out_string
Date: Mon, 4 Jul 2011 09:01:18 +0800 [thread overview]
Message-ID: <1309741278-26776-1-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <20110703210312.GA13742-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
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
next prev parent reply other threads:[~2011-07-04 1:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 15:56 [PATCH] dt: add helper functions to read u32 and string property values Thomas Abraham
[not found] ` <1309449370-9554-1-git-send-email-thomas.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-06-30 18:13 ` Grant Likely
[not found] ` <20110630181353.GA6674-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-07-03 3:55 ` Shawn Guo
[not found] ` <20110703035527.GB9742-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-07-03 21:03 ` Grant Likely
[not found] ` <20110703210312.GA13742-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-07-04 1:01 ` Shawn Guo [this message]
[not found] ` <1309741278-26776-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-04 5:47 ` [PATCH] dt: add 'const' for of_property_read_string parameter **out_string Grant Likely
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=1309741278-26776-1-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).