All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arch@vger.kernel.org, Russell King <linux@armlinux.org.uk>
Subject: [PATCH 2/5] clk: Prepare to remove asm-generic/clkdev.h
Date: Tue,  2 Jan 2018 17:35:13 -0800	[thread overview]
Message-ID: <20180103013516.18844-3-sboyd@codeaurora.org> (raw)
In-Reply-To: <20180103013516.18844-1-sboyd@codeaurora.org>

Now that all the users of asm/clkdev.h have been replaced with
the generic file we can get rid of the asm-generic file as well
and implement that code directly where it's used.

We only have one caller of __clkdev_alloc(), in clkdev.c so we
can easily remove that and drop the include of asm/clkdev.h in
linux/clkdev.h by putting the __clk_get/__clk_put inlines in
their respective location.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clk/clkdev.c   | 2 +-
 include/linux/clkdev.h | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 6b2f29df3f70..7513411140b6 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -256,7 +256,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
 {
 	struct clk_lookup_alloc *cla;
 
-	cla = __clkdev_alloc(sizeof(*cla));
+	cla = kzalloc(sizeof(*cla), GFP_KERNEL);
 	if (!cla)
 		return NULL;
 
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index 2eabc862abdb..ef98ee8c6358 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -12,7 +12,7 @@
 #ifndef __CLKDEV_H
 #define __CLKDEV_H
 
-#include <asm/clkdev.h>
+#include <linux/slab.h>
 
 struct clk;
 struct clk_hw;
@@ -55,6 +55,9 @@ int clk_hw_register_clkdev(struct clk_hw *, const char *, const char *);
 #ifdef CONFIG_COMMON_CLK
 int __clk_get(struct clk *clk);
 void __clk_put(struct clk *clk);
+#else
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
 #endif
 
 #endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2018-01-03  1:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03  1:35 [PATCH 0/5] Remove asm/clkdev.h and privatize __clk{get,put}() Stephen Boyd
2018-01-03  1:35 ` [PATCH 1/5] blackfin: Use generic clkdev.h header Stephen Boyd
2018-01-10 21:20   ` Stephen Boyd
2018-01-03  1:35 ` Stephen Boyd [this message]
2018-01-10 21:20   ` [PATCH 2/5] clk: Prepare to remove asm-generic/clkdev.h Stephen Boyd
2018-01-03  1:35 ` [PATCH 3/5] arch: Remove clkdev.h asm-generic from Kbuild Stephen Boyd
2018-01-03  8:43   ` Geert Uytterhoeven
2018-01-03  8:43     ` Geert Uytterhoeven
2018-01-03 15:37   ` Arnd Bergmann
2018-01-10 21:20   ` Stephen Boyd
2018-01-03  1:35 ` [PATCH 4/5] clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks Stephen Boyd
2018-01-03  2:58   ` Chen-Yu Tsai
2018-01-03 17:01     ` Stephen Boyd
2018-01-04 13:13   ` Maxime Ripard
2018-01-10 21:20   ` Stephen Boyd
2018-01-03  1:35 ` [PATCH 5/5] clk: Move __clk_{get,put}() into private clk.h API Stephen Boyd
2018-01-10 21:20   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180103013516.18844-3-sboyd@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mturquette@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.