From patchwork Thu Oct 5 01:25:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 114820 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp6553447edb; Wed, 4 Oct 2017 18:27:16 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAqdG2j2QL+6fo8v5ml3cR+OfIyiJmxGSdIPxar/Nwthvrwdg3o2jBvIr0XxEUABL22CJBv X-Received: by 10.98.73.67 with SMTP id w64mr8592742pfa.338.1507166835895; Wed, 04 Oct 2017 18:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507166835; cv=none; d=google.com; s=arc-20160816; b=qyNc5YxV6nI07D6Yjd20w+tUmrEf5FccF+mffwpg0r5X58cVPRWahByiFZeU7Jei8o z3AuyWwPOofILdZzsA6Oqy8ssP9zd/9yo/XUWdDVMSDhXUR4jlOoaEPxeRnYw0lfzvz4 3F6yL4KQLgG/hvbcVAiplDtFICptaUptrgxDIHFb9PRChHAacRYQ7fEC26yF0GXeC594 xBvlHdtyoiXiVULEvxwkbbC+exuWnsvyyLHojpOE0mCBEjr2+TRIkCLTgYJLh8IS3xpQ otT5JLq0TbfhXAAtSI5BYSwnZ/tqXwedQC+G9iOd87f0nScowKJtqrWROqlLkNSMJU9s MUhg== 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 :dkim-signature:dkim-filter:arc-authentication-results; bh=MP2EeLaQ9PX+ijY0ypLAN5gyxXeua+CVebvDz4LwY8w=; b=vrwe/R9qnyoGzOdUsBMSk7bTu00qA8qvRJUZsbBd/sdLzUQENB/ODjeD2IW8SzEAFi S0o2ci4Sdca7Il5wdzTXCJddr5YzsKq8rSzjlR9ASH621i8Mdjxz5OIh8Zly76IQ6e7+ vJySgG+Vyeogt4qCOtlf42awCx/cuuO4wcrowNO+/wMaDE7Zjm7GbgpMxTiJMGCaj1EC tGgi5JTmlsVMca1LCZ42vzTo3Wsb6mt4loQaYq42dBGiejM/2Xv1MVwjwJi6BcoL0EVq LlxK8KuP+2yq2SAIdp9jzXSzKOQrlcHDIjq45DadklNnjxou3mfJltDtDNeoGgb4G8iD snsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xn9olOCB; 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 b85si12525403pfc.492.2017.10.04.18.27.15; Wed, 04 Oct 2017 18:27:15 -0700 (PDT) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xn9olOCB; 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 S1751326AbdJEB1M (ORCPT + 26 others); Wed, 4 Oct 2017 21:27:12 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:33113 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbdJEB1K (ORCPT ); Wed, 4 Oct 2017 21:27:10 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id v951PuLS003852; Thu, 5 Oct 2017 10:25:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v951PuLS003852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1507166757; bh=MP2EeLaQ9PX+ijY0ypLAN5gyxXeua+CVebvDz4LwY8w=; h=From:To:Cc:Subject:Date:From; b=xn9olOCB2vQVsdl7Gt0BeZlTj2P57mZryeYQ0itR9fr91vxUlvLu5b1lbCICJbTSb NStf3g02GmozghtbvZ1oG0mHaXrwRuhhiFeH0wH0DqaxbGXP+7SPaMlkoZpY9LzggF fthAjjwXnBrnzsluGG6EyWwa+LQpywUzJhn2PeeUfhfsWdTSndpNo2vg2vx2BQPPUC 6AaaduPNKTNl3pnAk4gKTzXBGVqEJJQf+qWRYoXJh3v5GVDWS89/WvysVjPOK5QEbF Avw7xzgyCKliB1SEl0ZRDpIxMYpkGP+tIMmbUr+afdMEXBYz80GG9JpF6a3MQklkOt WQDBm59IR9tVg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Stephen Warren , Masahiro Yamada , linux-fbdev@vger.kernel.org, Michael Turquette , Stephen Boyd , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, Hans de Goede , Russell King Subject: [RFC PATCH] clk: move of_clk_get_parent_count() declaration to Date: Thu, 5 Oct 2017 10:25:51 +0900 Message-Id: <1507166751-2012-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock consumer, drivers/video/fbdev/simplefb.c, includes just for calling of_clk_get_parent_count(). This is ugly. Looking at simplefb_clocks_get(), of_clk_get_parent_count() seems useful for clock consumers as well as for clock providers. Unfortunately, we do not have a good home for declarations shared between consumers and providers. Create a new header , and move it over to it. This header must be included via or (this is why it is prefixed with double-underscore). Add #error so the build terminates if it is included directly. Signed-off-by: Masahiro Yamada --- drivers/video/fbdev/simplefb.c | 1 - include/linux/__clk.h | 31 +++++++++++++++++++++++++++++++ include/linux/clk-provider.h | 7 ++----- include/linux/clk.h | 2 ++ 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 include/linux/__clk.h -- 2.7.4 diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index a3c44ec..17f0aec 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/include/linux/__clk.h b/include/linux/__clk.h new file mode 100644 index 0000000..a8b86bf --- /dev/null +++ b/include/linux/__clk.h @@ -0,0 +1,31 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX___CLK_H +#define __LINUX___CLK_H + +/* This header contains stuff shared between consumers and providers. */ + +#if !defined(__LINUX_CLK_H) && !defined(__LINUX_CLK_PROVIDER_H) +#error "Please don't include directly, include or instead." +#endif + +struct device_node; + +#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) + +unsigned int of_clk_get_parent_count(struct device_node *np); + +#else + +static inline unsigned int of_clk_get_parent_count(struct device_node *np) +{ + return 0; +} + +#endif + +#endif /* __LINUX___CLK_H */ diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 5100ec1..cd9bca1 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -14,6 +14,8 @@ #include #include +#include "__clk.h" + #ifdef CONFIG_COMMON_CLK /* @@ -823,7 +825,6 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec, struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data); -unsigned int of_clk_get_parent_count(struct device_node *np); int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size); const char *of_clk_get_parent_name(struct device_node *np, int index); @@ -868,10 +869,6 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data) { return ERR_PTR(-ENOENT); } -static inline unsigned int of_clk_get_parent_count(struct device_node *np) -{ - return 0; -} static inline int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size) { diff --git a/include/linux/clk.h b/include/linux/clk.h index 12c96d9..83d24cb 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -16,6 +16,8 @@ #include #include +#include "__clk.h" + struct device; struct clk; struct device_node;