mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
OPP: Reuse dev_pm_opp_get_freq_indexed()
Reuse dev_pm_opp_get_freq_indexed() from dev_pm_opp_get_freq(). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
parent
034d6aac21
commit
746de82550
@ -176,27 +176,6 @@ unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dev_pm_opp_get_power);
|
||||
|
||||
/**
|
||||
* dev_pm_opp_get_freq() - Gets the frequency corresponding to an available opp
|
||||
* @opp: opp for which frequency has to be returned for
|
||||
*
|
||||
* Return: frequency in hertz corresponding to the opp, else
|
||||
* return 0
|
||||
*/
|
||||
unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
|
||||
{
|
||||
if (IS_ERR_OR_NULL(opp)) {
|
||||
pr_err("%s: Invalid parameters\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!assert_single_clk(opp->opp_table))
|
||||
return 0;
|
||||
|
||||
return opp->rates[0];
|
||||
}
|
||||
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
|
||||
|
@ -103,8 +103,6 @@ int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *su
|
||||
|
||||
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);
|
||||
@ -214,11 +212,6 @@ static inline unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
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;
|
||||
@ -669,4 +662,9 @@ static inline void dev_pm_opp_put_prop_name(int token)
|
||||
dev_pm_opp_clear_config(token);
|
||||
}
|
||||
|
||||
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
|
||||
{
|
||||
return dev_pm_opp_get_freq_indexed(opp, 0);
|
||||
}
|
||||
|
||||
#endif /* __LINUX_OPP_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user