Merge branch 'clk-parent-rewrite-1' into clk-next
authorStephen Boyd <sboyd@kernel.org>
Tue, 7 May 2019 18:46:13 +0000 (11:46 -0700)
committerStephen Boyd <sboyd@kernel.org>
Tue, 7 May 2019 18:46:13 +0000 (11:46 -0700)
 - Rewrite how clk parents can be specified to be DT/clkdev based instead
   of just string based

* clk-parent-rewrite-1:
  clk: Cache core in clk_fetch_parent_index() without names
  clk: fixed-factor: Initialize clk_init_data on stack
  clk: fixed-factor: Let clk framework find parent
  clk: Allow parents to be specified via clkspec index
  clk: Look for parents with clkdev based clk_lookups
  clk: Allow parents to be specified without string names
  clk: Add of_clk_hw_register() API for early clk drivers
  driver core: Let dev_of_node() accept a NULL dev
  clk: Prepare for clk registration API that uses DT nodes
  clkdev: Move clk creation outside of 'clocks_mutex'

1  2 
drivers/clk/clk-fixed-factor.c
drivers/clk/clk.c
include/linux/clk-provider.h
include/linux/device.h

@@@ -84,8 -86,11 +86,11 @@@ __clk_hw_register_fixed_factor(struct d
  
        init.name = name;
        init.ops = &clk_fixed_factor_ops;
 -      init.flags = flags | CLK_IS_BASIC;
 +      init.flags = flags;
-       init.parent_names = &parent_name;
+       if (parent_name)
+               init.parent_names = &parent_name;
+       else
+               init.parent_data = &pdata;
        init.num_parents = 1;
  
        hw = &fix->hw;
@@@ -3428,6 -3591,22 +3591,24 @@@ fail_name
  fail_out:
        return ERR_PTR(ret);
  }
 - * clk_register is the primary interface for populating the clock tree with new
 - * clock nodes.  It returns a pointer to the newly allocated struct clk which
+ /**
+  * clk_register - allocate a new clock, register it and return an opaque cookie
+  * @dev: device that is registering this clock
+  * @hw: link to hardware-specific clock data
+  *
++ * clk_register is the *deprecated* interface for populating the clock tree with
++ * new clock nodes. Use clk_hw_register() instead.
++ *
++ * Returns: a pointer to the newly allocated struct clk which
+  * cannot be dereferenced by driver code but may be used in conjunction with the
+  * rest of the clock API.  In the event of an error clk_register will return an
+  * error code; drivers must test for an error code after calling clk_register.
+  */
+ struct clk *clk_register(struct device *dev, struct clk_hw *hw)
+ {
+       return __clk_register(dev, dev_of_node(dev), hw);
+ }
  EXPORT_SYMBOL_GPL(clk_register);
  
  /**
Simple merge
Simple merge