diff mbox series

[1/2] OPP: Introduce devm_pm_opp_set_config_regulators

Message ID 20240606113334.396693-1-primoz.fiser@norik.com (mailing list archive)
State New
Delegated to: viresh kumar
Headers show
Series [1/2] OPP: Introduce devm_pm_opp_set_config_regulators | expand

Commit Message

Primoz Fiser June 6, 2024, 11:33 a.m. UTC
Introduce devm_pm_opp_set_config_regulators() function. This is device
managed version of dev_pm_opp_set_config_regulators so caller don't need
to worry about managing returned tokens.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
---
 include/linux/pm_opp.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index dd7c8441af42..fa515aab47c9 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -664,6 +664,16 @@  static inline int dev_pm_opp_set_config_regulators(struct device *dev,
 	return dev_pm_opp_set_config(dev, &config);
 }
 
+static inline int devm_pm_opp_set_config_regulators(struct device *dev,
+						   config_regulators_t helper)
+{
+	struct dev_pm_opp_config config = {
+		.config_regulators = helper,
+	};
+
+	return devm_pm_opp_set_config(dev, &config);
+}
+
 static inline void dev_pm_opp_put_config_regulators(int token)
 {
 	dev_pm_opp_clear_config(token);