summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2015-04-27 21:55:42 +0300
committerTero Kristo <t-kristo@ti.com>2015-06-02 12:31:46 +0300
commite9e63088e4f93cf4ed7999294c09905b7dcb4d32 (patch)
treee22481c9cc1c77e98cb34dd484bdd2b977ea0a96 /arch
parent9e11814ab8f08a0932c583b9e1504acac52ec7b3 (diff)
clk: ti: remove exported ll_ops struct, instead add an API for registration
We should avoid exporting data from drivers, instead use an API for registering the clock low level operations. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clock.c17
-rw-r--r--arch/arm/mach-omap2/clock.h1
-rw-r--r--arch/arm/mach-omap2/io.c2
3 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 99875dba803a..40a88c2e4016 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -113,6 +113,19 @@ static struct ti_clk_ll_ops omap_clk_ll_ops = {
};
/**
+ * omap2_clk_setup_ll_ops - setup clock driver low-level ops
+ *
+ * Sets up clock driver low-level platform ops. These are needed
+ * for register accesses and various other misc platform operations.
+ * Returns 0 on success, -EBUSY if low level ops have been registered
+ * already.
+ */
+int __init omap2_clk_setup_ll_ops(void)
+{
+ return ti_clk_setup_ll_ops(&omap_clk_ll_ops);
+}
+
+/**
* omap2_clk_provider_init - initialize a clock provider
* @match_table: DT device table to match for devices to init
* @np: device node pointer for the this clock provider
@@ -130,8 +143,6 @@ int __init omap2_clk_provider_init(struct device_node *np, int index,
{
struct clk_iomap *io;
- ti_clk_ll_ops = &omap_clk_ll_ops;
-
io = kzalloc(sizeof(*io), GFP_KERNEL);
io->regmap = syscon;
@@ -155,8 +166,6 @@ void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem)
{
struct clk_iomap *io;
- ti_clk_ll_ops = &omap_clk_ll_ops;
-
io = memblock_virt_alloc(sizeof(*io), 0);
io->mem = mem;
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 1986ab216b1a..a7051d6a05e9 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -83,6 +83,7 @@ struct regmap;
int __init omap2_clk_provider_init(struct device_node *np, int index,
struct regmap *syscon, void __iomem *mem);
void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem);
+int __init omap2_clk_setup_ll_ops(void);
void __init ti_clk_init_features(void);
#endif
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 74678565cd97..a253aafbb9a2 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -722,6 +722,8 @@ int __init omap_clk_init(void)
ti_clk_init_features();
+ omap2_clk_setup_ll_ops();
+
if (of_have_populated_dt()) {
ret = omap_control_init();
if (ret)