forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/clk/clk-devres.c
....@@ -1,9 +1,4 @@
1
-/*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License version 2 as
4
- * published by the Free Software Foundation.
5
- */
6
-
1
+// SPDX-License-Identifier: GPL-2.0
72 #include <linux/clk.h>
83 #include <linux/device.h>
94 #include <linux/export.h>
....@@ -97,13 +92,20 @@
9792 }
9893 EXPORT_SYMBOL_GPL(devm_clk_bulk_get_optional);
9994
95
+static void devm_clk_bulk_release_all(struct device *dev, void *res)
96
+{
97
+ struct clk_bulk_devres *devres = res;
98
+
99
+ clk_bulk_put_all(devres->num_clks, devres->clks);
100
+}
101
+
100102 int __must_check devm_clk_bulk_get_all(struct device *dev,
101103 struct clk_bulk_data **clks)
102104 {
103105 struct clk_bulk_devres *devres;
104106 int ret;
105107
106
- devres = devres_alloc(devm_clk_bulk_release,
108
+ devres = devres_alloc(devm_clk_bulk_release_all,
107109 sizeof(*devres), GFP_KERNEL);
108110 if (!devres)
109111 return -ENOMEM;