> This basically reverts commit efa850487a6b6742 ("clk: Inform the core
> about consumer devices").
>
> This commit added a struct device pointer member to struct clk and a
> parameter to clk_hw_create_clk(), but the new member was never used
> beyond setting.
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> drivers/clk/clk.c | 14 +++++---------
> drivers/clk/clk.h | 11 ++++-------
> drivers/clk/clkdev.c | 14 ++++----------
> 3 files changed, 13 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 673eac47450b..858f4d60ed2d 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -160,7 +160,6 @@ struct clk_core {
>
> struct clk {
> struct clk_core *core;
> - struct device *dev;
> const char *dev_id;
> const char *con_id;
> unsigned long min_rate;
> @@ -4249,7 +4248,6 @@ static void free_clk(struct clk *clk)
> /**
> * clk_hw_create_clk: Allocate and link a clk consumer to a clk_core given
> * a clk_hw
> - * @dev: clk consumer device
> * @hw: clk_hw associated with the clk being consumed
> * @dev_id: string describing device name
> * @con_id: connection ID string on device
> @@ -4259,9 +4257,8 @@ static void free_clk(struct clk *clk)
> * consumers. It connects a consumer to the clk_core and clk_hw structures
> * used by the framework and clk provider respectively.
> */
> -struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
> - const char *dev_id, const char *con_id,
> - struct module *owner)
> +struct clk *clk_hw_create_clk(struct clk_hw *hw, const char *dev_id,
> + const char *con_id, struct module *owner)
> {
> struct clk *clk;
> struct clk_core *core;
> @@ -4274,7 +4271,6 @@ struct clk *clk_hw_create_clk(struct device *dev,
> struct clk_hw *hw,
> clk = alloc_clk(core, dev_id, con_id);
> if (IS_ERR(clk))
> return clk;
> - clk->dev = dev;
>
> /*
> * Pin the provider module only when the consumer lives in a different
> @@ -4303,7 +4299,7 @@ struct clk *__clk_hw_get_clk(struct clk_hw *hw, const
> char *con_id,
> struct device *dev = hw->core->dev;
> const char *name = dev ? dev_name(dev) : NULL;
>
> - return clk_hw_create_clk(dev, hw, name, con_id, owner);
> + return clk_hw_create_clk(hw, name, con_id, owner);
> }
> EXPORT_SYMBOL(__clk_hw_get_clk);
>
> @@ -5392,7 +5388,7 @@ struct clk *of_clk_get_from_provider(struct
> of_phandle_args *clkspec)
> {
> struct clk_hw *hw = of_clk_get_hw_from_clkspec(clkspec);
>
> - return clk_hw_create_clk(NULL, hw, NULL, __func__, NULL);
> + return clk_hw_create_clk(hw, NULL, __func__, NULL);
> }
> EXPORT_SYMBOL_GPL(of_clk_get_from_provider);
>
> @@ -5420,7 +5416,7 @@ static struct clk *__of_clk_get(struct device_node *np,
> {
> struct clk_hw *hw = of_clk_get_hw(np, index, con_id);
>
> - return clk_hw_create_clk(NULL, hw, dev_id, con_id, NULL);
> + return clk_hw_create_clk(hw, dev_id, con_id, NULL);
> }
>
> struct clk *of_clk_get(struct device_node *np, int index)
> diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h
> index 5009380863a9..ba23700149de 100644
> --- a/drivers/clk/clk.h
> +++ b/drivers/clk/clk.h
> @@ -5,8 +5,6 @@
> */
>
> struct clk_hw;
> -struct device;
> -struct of_phandle_args;
Did you mean to remove of_phandle_args?
Otherwise this looks good to me.
Brian
--
Brian Masney <[email protected]>