diff options
| author | Dong Aisheng <[email protected]> | 2017-05-19 21:49:05 +0800 |
|---|---|---|
| committer | Stephen Boyd <[email protected]> | 2017-06-02 15:37:49 -0700 |
| commit | 618aee02e2f57042f4cdeab228caf631e524b281 (patch) | |
| tree | 56721ee9aa6c4ddf7fb17ad136a7b113195b4a1d /include/linux | |
| parent | 266e4e9d9150e98141b85c7400f8aa3cd57a7f9b (diff) | |
clk: add managed version of clk_bulk_get
This patch introduces the managed version of clk_bulk_get.
Cc: Michael Turquette <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Russell King <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Anson Huang <[email protected]>
Cc: Robin Gong <[email protected]>
Cc: Bai Ping <[email protected]>
Cc: Leonard Crestez <[email protected]>
Cc: Octavian Purdila <[email protected]>
Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 72b0cfce9165..c673f0b91751 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -281,6 +281,21 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks, struct clk_bulk_data *clks); /** + * devm_clk_bulk_get - managed get multiple clk consumers + * @dev: device for clock "consumer" + * @num_clks: the number of clk_bulk_data + * @clks: the clk_bulk_data table of consumer + * + * Return 0 on success, an errno on failure. + * + * This helper function allows drivers to get several clk + * consumers in one operation with management, the clks will + * automatically be freed when the device is unbound. + */ +int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, + struct clk_bulk_data *clks); + +/** * devm_clk_get - lookup and obtain a managed reference to a clock producer. * @dev: device for clock "consumer" * @id: clock consumer ID @@ -550,6 +565,12 @@ static inline struct clk *devm_clk_get(struct device *dev, const char *id) return NULL; } +static inline int devm_clk_bulk_get(struct device *dev, int num_clks, + struct clk_bulk_data *clks) +{ + return 0; +} + static inline struct clk *devm_get_clk_from_child(struct device *dev, struct device_node *np, const char *con_id) { |