| .. | .. |
|---|
| 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 |
|---|
| 7 | 2 | #include <linux/clk.h> |
|---|
| 8 | 3 | #include <linux/device.h> |
|---|
| 9 | 4 | #include <linux/export.h> |
|---|
| .. | .. |
|---|
| 97 | 92 | } |
|---|
| 98 | 93 | EXPORT_SYMBOL_GPL(devm_clk_bulk_get_optional); |
|---|
| 99 | 94 | |
|---|
| 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 | + |
|---|
| 100 | 102 | int __must_check devm_clk_bulk_get_all(struct device *dev, |
|---|
| 101 | 103 | struct clk_bulk_data **clks) |
|---|
| 102 | 104 | { |
|---|
| 103 | 105 | struct clk_bulk_devres *devres; |
|---|
| 104 | 106 | int ret; |
|---|
| 105 | 107 | |
|---|
| 106 | | - devres = devres_alloc(devm_clk_bulk_release, |
|---|
| 108 | + devres = devres_alloc(devm_clk_bulk_release_all, |
|---|
| 107 | 109 | sizeof(*devres), GFP_KERNEL); |
|---|
| 108 | 110 | if (!devres) |
|---|
| 109 | 111 | return -ENOMEM; |
|---|