From patchwork Wed Aug 12 23:12:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 7004371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00BD0C05AC for ; Wed, 12 Aug 2015 23:15:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18D9E205C2 for ; Wed, 12 Aug 2015 23:15:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 292DF205B5 for ; Wed, 12 Aug 2015 23:15:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZPfCn-0004Aw-JK; Wed, 12 Aug 2015 23:13:09 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZPfCj-00046R-B7 for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2015 23:13:06 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 96529141441; Wed, 12 Aug 2015 23:12:43 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 89264141482; Wed, 12 Aug 2015 23:12:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 04007141441; Wed, 12 Aug 2015 23:12:42 +0000 (UTC) From: Stephen Boyd To: Mike Turquette , Stephen Boyd Subject: [PATCH 1/2] clk: Constify clk_hw argument to provider APIs Date: Wed, 12 Aug 2015 16:12:40 -0700 Message-Id: <1439421161-17868-1-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 2.3.0.rc1.33.g42e4583 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150812_161305_469837_31D06FA3 X-CRM114-Status: GOOD ( 12.71 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We don't modify the clk_hw argument in these functions, so it's safe to mark it as const. Signed-off-by: Stephen Boyd --- drivers/clk/clk.c | 15 ++++++++------- include/linux/clk-provider.h | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 128ad748b682..8e6688d1ecbd 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -278,7 +278,7 @@ const char *__clk_get_name(struct clk *clk) } EXPORT_SYMBOL_GPL(__clk_get_name); -const char *clk_hw_get_name(struct clk_hw *hw) +const char *clk_hw_get_name(const struct clk_hw *hw) { return hw->core->name; } @@ -290,13 +290,13 @@ struct clk_hw *__clk_get_hw(struct clk *clk) } EXPORT_SYMBOL_GPL(__clk_get_hw); -unsigned int clk_hw_get_num_parents(struct clk_hw *hw) +unsigned int clk_hw_get_num_parents(const struct clk_hw *hw) { return hw->core->num_parents; } EXPORT_SYMBOL_GPL(clk_hw_get_num_parents); -struct clk_hw *clk_hw_get_parent(struct clk_hw *hw) +struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw) { return hw->core->parent ? hw->core->parent->hw : NULL; } @@ -359,7 +359,8 @@ static struct clk_core *clk_core_get_parent_by_index(struct clk_core *core, return core->parents[index]; } -struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, unsigned int index) +struct clk_hw * +clk_hw_get_parent_by_index(const struct clk_hw *hw, unsigned int index) { struct clk_core *parent; @@ -395,7 +396,7 @@ out: return ret; } -unsigned long clk_hw_get_rate(struct clk_hw *hw) +unsigned long clk_hw_get_rate(const struct clk_hw *hw) { return clk_core_get_rate_nolock(hw->core); } @@ -415,13 +416,13 @@ unsigned long __clk_get_flags(struct clk *clk) } EXPORT_SYMBOL_GPL(__clk_get_flags); -unsigned long clk_hw_get_flags(struct clk_hw *hw) +unsigned long clk_hw_get_flags(const struct clk_hw *hw) { return hw->core->flags; } EXPORT_SYMBOL_GPL(clk_hw_get_flags); -bool clk_hw_is_prepared(struct clk_hw *hw) +bool clk_hw_is_prepared(const struct clk_hw *hw) { return clk_core_is_prepared(hw->core); } diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 0d3128fbc14e..3ecc07d0da77 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -607,17 +607,17 @@ void devm_clk_unregister(struct device *dev, struct clk *clk); /* helper functions */ const char *__clk_get_name(struct clk *clk); -const char *clk_hw_get_name(struct clk_hw *hw); +const char *clk_hw_get_name(const struct clk_hw *hw); struct clk_hw *__clk_get_hw(struct clk *clk); -unsigned int clk_hw_get_num_parents(struct clk_hw *hw); -struct clk_hw *clk_hw_get_parent(struct clk_hw *hw); -struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, +unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); +struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw); +struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw, unsigned int index); unsigned int __clk_get_enable_count(struct clk *clk); -unsigned long clk_hw_get_rate(struct clk_hw *hw); +unsigned long clk_hw_get_rate(const struct clk_hw *hw); unsigned long __clk_get_flags(struct clk *clk); -unsigned long clk_hw_get_flags(struct clk_hw *hw); -bool clk_hw_is_prepared(struct clk_hw *hw); +unsigned long clk_hw_get_flags(const struct clk_hw *hw); +bool clk_hw_is_prepared(const struct clk_hw *hw); bool __clk_is_enabled(struct clk *clk); struct clk *__clk_lookup(const char *name); int __clk_mux_determine_rate(struct clk_hw *hw,