summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-08-30 13:02:40 +0200
committerChanho Park <chanho61.park@samsung.com>2014-08-08 14:36:27 +0900
commitadf831f534d287df09e52d76f048e81b3fe14882 (patch)
tree1e73ba3c2be8b7eab193881b269c8e510202279e /arch
parentce91c726c881291629e8ec95c42424174a0d91a3 (diff)
downloadlinux-3.10-adf831f534d287df09e52d76f048e81b3fe14882.tar.gz
linux-3.10-adf831f534d287df09e52d76f048e81b3fe14882.tar.bz2
linux-3.10-adf831f534d287df09e52d76f048e81b3fe14882.zip
clk: Add common __clk_get(), __clk_put() implementations
This patch adds common __clk_get(), __clk_put() clkdev helpers which replace their platform specific counterparts when the common clock API is enabled. The owner module pointer field is added to struct clk so a reference to the clock supplier module can be taken by the clock consumers. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> --- Changes since v5: - none. Changes since v4: - dropped unnecessary struct module forward declaration from clk-provider.h Changes since v3: - dropped exporting of __clk_get(), __clk_put(). Changes since v2: - fixed handling of NULL clock pointers in __clk_get(), __clk_put();
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/clkdev.h2
-rw-r--r--arch/blackfin/include/asm/clkdev.h2
-rw-r--r--arch/mips/include/asm/clkdev.h2
-rw-r--r--arch/sh/include/asm/clkdev.h2
4 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h
index 80751c15c30..4e8a4b27d7c 100644
--- a/arch/arm/include/asm/clkdev.h
+++ b/arch/arm/include/asm/clkdev.h
@@ -14,12 +14,14 @@
#include <linux/slab.h>
+#ifndef CONFIG_COMMON_CLK
#ifdef CONFIG_HAVE_MACH_CLKDEV
#include <mach/clkdev.h>
#else
#define __clk_get(clk) ({ 1; })
#define __clk_put(clk) do { } while (0)
#endif
+#endif
static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
{
diff --git a/arch/blackfin/include/asm/clkdev.h b/arch/blackfin/include/asm/clkdev.h
index 9053beda8c5..7ac2436856a 100644
--- a/arch/blackfin/include/asm/clkdev.h
+++ b/arch/blackfin/include/asm/clkdev.h
@@ -8,7 +8,9 @@ static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
return kzalloc(size, GFP_KERNEL);
}
+#ifndef CONFIG_COMMON_CLK
#define __clk_put(clk)
#define __clk_get(clk) ({ 1; })
+#endif
#endif
diff --git a/arch/mips/include/asm/clkdev.h b/arch/mips/include/asm/clkdev.h
index 262475414e5..1b3ad7b09dc 100644
--- a/arch/mips/include/asm/clkdev.h
+++ b/arch/mips/include/asm/clkdev.h
@@ -14,8 +14,10 @@
#include <linux/slab.h>
+#ifndef CONFIG_COMMON_CLK
#define __clk_get(clk) ({ 1; })
#define __clk_put(clk) do { } while (0)
+#endif
static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
{
diff --git a/arch/sh/include/asm/clkdev.h b/arch/sh/include/asm/clkdev.h
index 6ba91868201..c41901465fb 100644
--- a/arch/sh/include/asm/clkdev.h
+++ b/arch/sh/include/asm/clkdev.h
@@ -25,7 +25,9 @@ static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
return kzalloc(size, GFP_KERNEL);
}
+#ifndef CONFIG_COMMON_CLK
#define __clk_put(clk)
#define __clk_get(clk) ({ 1; })
+#endif
#endif /* __CLKDEV_H__ */