From patchwork Fri May 23 15:44:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 30820 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1BC1D20369 for ; Fri, 23 May 2014 15:44:28 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id uq10sf2508369igb.9 for ; Fri, 23 May 2014 08:44:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=vOSQJHPQ54l521maubNQGJXiuIvLJKDWvUPHF7nVzLE=; b=RCO9qKW7dxZ5VIjM0KMopFd/YpNl1A8j5rwDouKQrAaQgGuF3+WUrovzGpgk4iUlE/ 4ir7mO9NO7q46hbhcSD8/Gz8Z+A5RSh7lueiKguyiv+mnRdnx8cdhEzQTMMTTrBTwwMj VvyuruIywuNybWFmyMIdYzMFKKfJgAiFclCne8s+9QqVvc6xCoPjvh7zmXWXvn+qnyp8 ZYsBrb2P4z4oZKBAJl9JDZHvaBqPA68iAt2QWNKlWWwJ7JlXxiCXOVLNS1UVTPirr0Fh TkLhmMj53TPxZl+CK0evDoeO8rpiJixYEYid3b5/6sneuMfwvwO1QYqMS7B+iHooerI3 SDoA== X-Gm-Message-State: ALoCoQlyj+Se3njkWh8dPrxSxgfLhDT8yDNGL6EHbz2fTqLxfs+3BwYMogTrCSO/6MA2oh17qlLC X-Received: by 10.42.233.133 with SMTP id jy5mr2204546icb.32.1400859867493; Fri, 23 May 2014 08:44:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.231 with SMTP id h94ls1829585qgd.49.gmail; Fri, 23 May 2014 08:44:27 -0700 (PDT) X-Received: by 10.52.76.134 with SMTP id k6mr1044144vdw.62.1400859867315; Fri, 23 May 2014 08:44:27 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id bo9si1850716vcb.86.2014.05.23.08.44.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id pa12so6401239veb.40 for ; Fri, 23 May 2014 08:44:27 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr5052228vcb.0.1400859867228; Fri, 23 May 2014 08:44:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp41893vcb; Fri, 23 May 2014 08:44:26 -0700 (PDT) X-Received: by 10.42.148.67 with SMTP id q3mr5504718icv.5.1400859866689; Fri, 23 May 2014 08:44:26 -0700 (PDT) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx.google.com with ESMTPS id n11si6046205icr.43.2014.05.23.08.44.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 209.85.213.171 as permitted sender) client-ip=209.85.213.171; Received: by mail-ig0-f171.google.com with SMTP id c1so817081igq.16 for ; Fri, 23 May 2014 08:44:26 -0700 (PDT) X-Received: by 10.50.124.101 with SMTP id mh5mr5328217igb.41.1400859866295; Fri, 23 May 2014 08:44:26 -0700 (PDT) Received: from localhost.localdomain (host109-148-113-200.range109-148.btcentralplus.com. [109.148.113.200]) by mx.google.com with ESMTPSA id m1sm4885479ige.22.2014.05.23.08.44.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:44:25 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: broonie@kernel.org, Lee Jones Subject: [PATCH] regulator: Constify the pointer to alias name array Date: Fri, 23 May 2014 16:44:10 +0100 Message-Id: <1400859850-24505-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Toughen-up checks for read-only regulator names. Signed-off-by: Lee Jones --- drivers/regulator/core.c | 7 ++++--- drivers/regulator/devres.c | 6 +++--- include/linux/mfd/core.h | 2 +- include/linux/regulator/consumer.h | 36 ++++++++++++++++++++---------------- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 9a09f3c..ba28d29 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1597,9 +1597,10 @@ EXPORT_SYMBOL_GPL(regulator_unregister_supply_alias); * registered any aliases that were registered will be removed * before returning to the caller. */ -int regulator_bulk_register_supply_alias(struct device *dev, const char **id, +int regulator_bulk_register_supply_alias(struct device *dev, + const char *const *id, struct device *alias_dev, - const char **alias_id, + const char *const *alias_id, int num_id) { int i; @@ -1637,7 +1638,7 @@ EXPORT_SYMBOL_GPL(regulator_bulk_register_supply_alias); * aliases in one operation. */ void regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, + const char *const *id, int num_id) { int i; diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c index f44818b..8f785bc 100644 --- a/drivers/regulator/devres.c +++ b/drivers/regulator/devres.c @@ -360,9 +360,9 @@ EXPORT_SYMBOL_GPL(devm_regulator_unregister_supply_alias); * will be removed before returning to the caller. */ int devm_regulator_bulk_register_supply_alias(struct device *dev, - const char **id, + const char *const *id, struct device *alias_dev, - const char **alias_id, + const char *const *alias_id, int num_id) { int i; @@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(devm_regulator_bulk_register_supply_alias); * will ensure that the resource is freed. */ void devm_regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, + const char *const *id, int num_id) { int i; diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index bdba8c6..f543de9 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -63,7 +63,7 @@ struct mfd_cell { /* A list of regulator supplies that should be mapped to the MFD * device rather than the child device when requested */ - const char **parent_supplies; + const char * const *parent_supplies; int num_parent_supplies; }; diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 1a4a8c1..ccd3d77 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -151,11 +151,13 @@ int regulator_register_supply_alias(struct device *dev, const char *id, const char *alias_id); void regulator_unregister_supply_alias(struct device *dev, const char *id); -int regulator_bulk_register_supply_alias(struct device *dev, const char **id, +int regulator_bulk_register_supply_alias(struct device *dev, + const char *const *id, struct device *alias_dev, - const char **alias_id, int num_id); + const char *const *alias_id, + int num_id); void regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, int num_id); + const char * const *id, int num_id); int devm_regulator_register_supply_alias(struct device *dev, const char *id, struct device *alias_dev, @@ -164,12 +166,12 @@ void devm_regulator_unregister_supply_alias(struct device *dev, const char *id); int devm_regulator_bulk_register_supply_alias(struct device *dev, - const char **id, + const char *const *id, struct device *alias_dev, - const char **alias_id, + const char *const *alias_id, int num_id); void devm_regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, + const char *const *id, int num_id); /* regulator output control and status */ @@ -290,17 +292,17 @@ static inline void regulator_unregister_supply_alias(struct device *dev, } static inline int regulator_bulk_register_supply_alias(struct device *dev, - const char **id, - struct device *alias_dev, - const char **alias_id, - int num_id) + const char *const *id, + struct device *alias_dev, + const char * const *alias_id, + int num_id) { return 0; } static inline void regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, - int num_id) + const char * const *id, + int num_id) { } @@ -317,15 +319,17 @@ static inline void devm_regulator_unregister_supply_alias(struct device *dev, { } -static inline int devm_regulator_bulk_register_supply_alias( - struct device *dev, const char **id, struct device *alias_dev, - const char **alias_id, int num_id) +static inline int devm_regulator_bulk_register_supply_alias(struct device *dev, + const char *const *id, + struct device *alias_dev, + const char *const *alias_id, + int num_id) { return 0; } static inline void devm_regulator_bulk_unregister_supply_alias( - struct device *dev, const char **id, int num_id) + struct device *dev, const char *const *id, int num_id) { }