From: Stephen Boyd Date: Tue, 7 May 2019 18:46:13 +0000 (-0700) Subject: Merge branch 'clk-parent-rewrite-1' into clk-next X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c1157f60d72e8b20efc670cef28883832f42406c;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'clk-parent-rewrite-1' into clk-next - 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' --- c1157f60d72e8b20efc670cef28883832f42406c diff --cc drivers/clk/clk-fixed-factor.c index 8aac2d1b6fea,2d988a7585d5..8b343e59dc61 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@@ -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; diff --cc drivers/clk/clk.c index 3e1708747cd2,dcb7e1cddd2d..aa51756fd4d6 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@@ -3428,6 -3591,22 +3591,24 @@@ fail_name fail_out: return ERR_PTR(ret); } + + /** + * 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 primary interface for populating the clock tree with new - * clock nodes. It returns a pointer to the newly allocated struct clk which ++ * 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); /**