From 44a6d4af33d773005e81bcbc587bfc1b60003739 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 5 Mar 2025 17:02:56 +0000 Subject: [PATCH] Revert "OPP: Introduce dev_pm_opp_get_freq_indexed() API" This reverts commit 7f73098bc6104eb06f85104a512a6728c9e6eaa2 which is commit 5f756d03e2c7db63c1df7148d7b1739f29ff1532 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I2e361b5c7e9306d76e606eaa5eb1fa87af5eed28 Signed-off-by: Greg Kroah-Hartman --- drivers/opp/core.c | 20 -------------------- include/linux/pm_opp.h | 7 ------- 2 files changed, 27 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 54fadfb01f3b..eb6c02876719 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -200,26 +200,6 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) } EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq); -/** - * dev_pm_opp_get_freq_indexed() - Gets the frequency corresponding to an - * available opp with specified index - * @opp: opp for which frequency has to be returned for - * @index: index of the frequency within the required opp - * - * Return: frequency in hertz corresponding to the opp with specified index, - * else return 0 - */ -unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index) -{ - if (IS_ERR_OR_NULL(opp) || index >= opp->opp_table->clk_count) { - pr_err("%s: Invalid parameters\n", __func__); - return 0; - } - - return opp->rates[index]; -} -EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq_indexed); - /** * dev_pm_opp_get_level() - Gets the level corresponding to an available opp * @opp: opp for which level value has to be returned for diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 8594e64777d2..1cc61f911a6d 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -117,8 +117,6 @@ unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp); unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); -unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index); - unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp); unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp, @@ -228,11 +226,6 @@ static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) return 0; } -static inline unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index) -{ - return 0; -} - static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp) { return 0;