From 4fd8e25317a3796897f98733915049da2479b1b5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 5 Mar 2025 17:03:00 +0000 Subject: [PATCH] Revert "OPP: Introduce dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs" This reverts commit 92fcb46659d5dbfdad0422a503e289085990a5d0 which is commit 142e17c1c2b48e3fb4f024e62ab6dee18f268694 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: I1af7c9d9e49c81fae8706dc5fcb1f80e5aaac0b0 Signed-off-by: Greg Kroah-Hartman --- drivers/opp/core.c | 56 ------------------------------------------ include/linux/pm_opp.h | 18 -------------- 2 files changed, 74 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index eb6c02876719..37702dc41532 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -653,34 +653,6 @@ struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, } EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil); -/** - * dev_pm_opp_find_freq_ceil_indexed() - Search for a rounded ceil freq for the - * clock corresponding to the index - * @dev: Device for which we do this operation - * @freq: Start frequency - * @index: Clock index - * - * Search for the matching ceil *available* OPP for the clock corresponding to - * the specified index from a starting freq for a device. - * - * Return: matching *opp and refreshes *freq accordingly, else returns - * ERR_PTR in case of error and should be handled using IS_ERR. Error return - * values can be: - * EINVAL: for bad pointer - * ERANGE: no match found for search - * ENODEV: if device not found in list of registered devices - * - * The callers are required to call dev_pm_opp_put() for the returned OPP after - * use. - */ -struct dev_pm_opp * -dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq, - u32 index) -{ - return _find_key_ceil(dev, freq, index, true, _read_freq, NULL); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil_indexed); - /** * dev_pm_opp_find_freq_floor() - Search for a rounded floor freq * @dev: device for which we do this operation @@ -706,34 +678,6 @@ struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, } EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor); -/** - * dev_pm_opp_find_freq_floor_indexed() - Search for a rounded floor freq for the - * clock corresponding to the index - * @dev: Device for which we do this operation - * @freq: Start frequency - * @index: Clock index - * - * Search for the matching floor *available* OPP for the clock corresponding to - * the specified index from a starting freq for a device. - * - * Return: matching *opp and refreshes *freq accordingly, else returns - * ERR_PTR in case of error and should be handled using IS_ERR. Error return - * values can be: - * EINVAL: for bad pointer - * ERANGE: no match found for search - * ENODEV: if device not found in list of registered devices - * - * The callers are required to call dev_pm_opp_put() for the returned OPP after - * use. - */ -struct dev_pm_opp * -dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq, - u32 index) -{ - return _find_key_floor(dev, freq, index, true, _read_freq, NULL); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor_indexed); - /** * dev_pm_opp_find_level_exact() - search for an exact level * @dev: device for which we do this operation diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 1cc61f911a6d..795665455caa 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -137,15 +137,9 @@ struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq); -struct dev_pm_opp *dev_pm_opp_find_freq_floor_indexed(struct device *dev, - unsigned long *freq, u32 index); - struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq); -struct dev_pm_opp *dev_pm_opp_find_freq_ceil_indexed(struct device *dev, - unsigned long *freq, u32 index); - struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, unsigned int level); @@ -280,24 +274,12 @@ static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, return ERR_PTR(-EOPNOTSUPP); } -static inline struct dev_pm_opp * -dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq, u32 index) -{ - return ERR_PTR(-EOPNOTSUPP); -} - static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq) { return ERR_PTR(-EOPNOTSUPP); } -static inline struct dev_pm_opp * -dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq, u32 index) -{ - return ERR_PTR(-EOPNOTSUPP); -} - static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, unsigned int level) {