From patchwork Mon Jul 4 01:01:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2432 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0B2F923F57 for ; Mon, 4 Jul 2011 00:50:30 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id BFD65A18035 for ; Mon, 4 Jul 2011 00:50:29 +0000 (UTC) Received: by qwb8 with SMTP id 8so3280196qwb.11 for ; Sun, 03 Jul 2011 17:50:29 -0700 (PDT) Received: by 10.229.7.3 with SMTP id b3mr4220348qcb.194.1309740629177; Sun, 03 Jul 2011 17:50:29 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs15503qcf; Sun, 3 Jul 2011 17:50:28 -0700 (PDT) Received: by 10.42.133.67 with SMTP id g3mr6228018ict.51.1309740628254; Sun, 03 Jul 2011 17:50:28 -0700 (PDT) Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id v4si17237850icy.16.2011.07.03.17.50.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 17:50:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iwc10 with SMTP id 10so4993246iwc.37 for ; Sun, 03 Jul 2011 17:50:27 -0700 (PDT) Received: by 10.42.145.66 with SMTP id e2mr5211284icv.262.1309740627315; Sun, 03 Jul 2011 17:50:27 -0700 (PDT) Received: from localhost.localdomain ([117.80.112.149]) by mx.google.com with ESMTPS id y1sm5820500ica.4.2011.07.03.17.50.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 17:50:25 -0700 (PDT) From: Shawn Guo To: devicetree-discuss@lists.ozlabs.org Cc: Grant Likely , patches@linaro.org, Shawn Guo Subject: [PATCH] dt: add 'const' for of_property_read_string parameter **out_string Date: Mon, 4 Jul 2011 09:01:18 +0800 Message-Id: <1309741278-26776-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <20110703210312.GA13742@ponder.secretlab.ca> References: <20110703210312.GA13742@ponder.secretlab.ca> 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 --- 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);