Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5872526ybv; Wed, 12 Feb 2020 01:43:58 -0800 (PST) X-Google-Smtp-Source: APXvYqziRzvLAAWUIfeRWEQPuecBMYmV1wQwfNb/Z6BddOFq4RqxeSW6NJOGKn10vy7FHqj79pLm X-Received: by 2002:a9d:7f12:: with SMTP id j18mr9022963otq.17.1581500638631; Wed, 12 Feb 2020 01:43:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581500638; cv=none; d=google.com; s=arc-20160816; b=p96BIoyYk5c4fBpoq/QnozZwVRpY+F7K73hJliqRXt+7yn0GEu9pKeSTdDZ1UGE7hN jJXeFaaN0mLVuMuhvY5ss3lHGJhWceySlBs/LubtW+giK7ejbFRlOavyJBnf5kMmtwPk kIxgc4SQ5CXosdl/xFhcAspaDqic4lMaqfA5NyTij9SJl37aSRs5XfX98JKZwHCY+RBM nShOl0rGuKtUHHbjzJJUPJ7qX4LnORQbVOMSI1u0G6QjoukR+x7n6qe6dKEJi4ZoUyKt ClFY8+osFr5TyGKvgKYHWfr2YKtIiw4noRsbr4CdMVFDyVbKY2rHByJImETERj21oA/6 hmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=1ny6/YthV+ttZVEUkxWvygpYsUQG6+hLmRQgMwH9/k4=; b=ANxQMz42fmNw1i5gejZhbWOuvmSJMYbksrHc69yh8I+pBEPLAAdUF41dsJz9/Xp+Od 79OJfEgQqXn4zQ2PbVVrfeKSsFSXOoOmlkvqtoiOydKYqxE6Pq4ineifHaeftF/3NNsl Mt3o2OWqr07cO3KsuhCfoL/560S626rUrtq9nyvUxm4XCWzu+9fQYNMLUCQtQqIhpu4k 30FsfKS4I+jjj3Hu1p/Y4fjBQHogI/X/gG/pmVk0jyjwkJOTjN/Llpmr3SXAp1ato3al eMWd8t1lVlreBpngGsOlV83WXMrbPxjgvEamLFbNPqxmZNCbfYdL0Tez0rOS2AHRm2uT zMgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si3603842otl.54.2020.02.12.01.43.46; Wed, 12 Feb 2020 01:43:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728959AbgBLJnU (ORCPT + 99 others); Wed, 12 Feb 2020 04:43:20 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:33084 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbgBLJnT (ORCPT ); Wed, 12 Feb 2020 04:43:19 -0500 Received: from ramsan ([84.195.182.253]) by michel.telenet-ops.be with bizsmtp id 1ljJ2200Q5USYZQ06ljJnX; Wed, 12 Feb 2020 10:43:18 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1j1oYA-0000xk-Cl; Wed, 12 Feb 2020 10:43:18 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1j1oYA-0000Vp-Am; Wed, 12 Feb 2020 10:43:18 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Rob Herring , Frank Rowand Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] of: clk: Make of_clk_get_parent_{count,name}() parameter const Date: Wed, 12 Feb 2020 10:43:17 +0100 Message-Id: <20200212094317.1150-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_clk_get_parent_count() and of_clk_get_parent_name() never modify the device nodes passed, so they can be const. Signed-off-by: Geert Uytterhoeven --- drivers/clk/clk.c | 4 ++-- include/linux/of_clk.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index e42145cd996a1f77..b6696c8e02518177 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -4713,7 +4713,7 @@ EXPORT_SYMBOL(of_clk_get_by_name); * * Returns: The number of clocks that are possible parents of this node */ -unsigned int of_clk_get_parent_count(struct device_node *np) +unsigned int of_clk_get_parent_count(const struct device_node *np) { int count; @@ -4725,7 +4725,7 @@ unsigned int of_clk_get_parent_count(struct device_node *np) } EXPORT_SYMBOL_GPL(of_clk_get_parent_count); -const char *of_clk_get_parent_name(struct device_node *np, int index) +const char *of_clk_get_parent_name(const struct device_node *np, int index) { struct of_phandle_args clkspec; struct property *prop; diff --git a/include/linux/of_clk.h b/include/linux/of_clk.h index c86fcad23fc21725..31b73a0da9db33e8 100644 --- a/include/linux/of_clk.h +++ b/include/linux/of_clk.h @@ -11,17 +11,17 @@ struct of_device_id; #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) -unsigned int of_clk_get_parent_count(struct device_node *np); -const char *of_clk_get_parent_name(struct device_node *np, int index); +unsigned int of_clk_get_parent_count(const struct device_node *np); +const char *of_clk_get_parent_name(const struct device_node *np, int index); void of_clk_init(const struct of_device_id *matches); #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ -static inline unsigned int of_clk_get_parent_count(struct device_node *np) +static inline unsigned int of_clk_get_parent_count(const struct device_node *np) { return 0; } -static inline const char *of_clk_get_parent_name(struct device_node *np, +static inline const char *of_clk_get_parent_name(const struct device_node *np, int index) { return NULL; -- 2.17.1