@@ -33,6 +33,12 @@ struct of_clk_provider {
static LIST_HEAD(of_clk_providers);
static DEFINE_MUTEX(of_clk_lock);
+static struct clk *of_clk_simple_get(struct of_phandle_args *clkspec,
+ void *data)
+{
+ return data;
+}
+
/**
* of_clk_add_provider() - Register a clock provider for a node
* @np: Device node pointer associated with clock provider
@@ -52,7 +58,10 @@ int of_clk_add_provider(struct device_node *np,
cp->node = of_node_get(np);
cp->data = data;
- cp->get = clk_src_get;
+ if (clk_src_get)
+ cp->get = clk_src_get;
+ else
+ cp->get = of_clk_simple_get;
mutex_lock(&of_clk_lock);
list_add(&cp->link, &of_clk_providers);
@@ -184,11 +193,6 @@ void __init of_clk_init(const struct of_device_id *matches)
}
}
-static struct clk *of_fixed_clk_get(struct of_phandle_args *a, void *data)
-{
- return data;
-}
-
/**
* of_fixed_clk_setup() - Setup function for simple fixed rate clock
*/
@@ -205,5 +209,5 @@ void __init of_fixed_clk_setup(struct device_node *node)
clk = clk_register_fixed_rate(NULL, clk_name, NULL, CLK_IS_ROOT, rate);
if (clk)
- of_clk_add_provider(node, of_fixed_clk_get, clk);
+ of_clk_add_provider(node, NULL, clk);
}