Merge tag 'clk-bulk-get-prep-enable' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Jul 2017 19:37:41 +0000 (12:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Jul 2017 19:37:41 +0000 (12:37 -0700)
Pull clk api update from Stephen Boyd:
 "Small patch to add the clk_bulk_prepare_enable() and
  clk_bulk_disable_unprepare() API to the newly introduced
  clk bulk APIs.

  It would be good to get this into the -rc1 so that other
  driver trees can use it for code targeted for the next
  merge window"

* tag 'clk-bulk-get-prep-enable' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: Provide bulk prepare_enable disable_unprepare variants

1  2 
include/linux/clk.h

diff --combined include/linux/clk.h
index 91bd464f4c9b1c61d9e929f124a980cb1b370856,690e6a6921e149afd764712d8dd7ea63fffc8c30..12c96d94d1faf2ee7cc9909b0d54ffd96bd8eda6
@@@ -657,6 -657,28 +657,28 @@@ static inline void clk_disable_unprepar
        clk_unprepare(clk);
  }
  
+ static inline int clk_bulk_prepare_enable(int num_clks,
+                                         struct clk_bulk_data *clks)
+ {
+       int ret;
+       ret = clk_bulk_prepare(num_clks, clks);
+       if (ret)
+               return ret;
+       ret = clk_bulk_enable(num_clks, clks);
+       if (ret)
+               clk_bulk_unprepare(num_clks, clks);
+       return ret;
+ }
+ static inline void clk_bulk_disable_unprepare(int num_clks,
+                                             struct clk_bulk_data *clks)
+ {
+       clk_bulk_disable(num_clks, clks);
+       clk_bulk_unprepare(num_clks, clks);
+ }
  #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
  struct clk *of_clk_get(struct device_node *np, int index);
  struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
@@@ -671,10 -693,6 +693,10 @@@ static inline struct clk *of_clk_get_by
  {
        return ERR_PTR(-ENOENT);
  }
 +static inline struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
 +{
 +      return ERR_PTR(-ENOENT);
 +}
  #endif
  
  #endif