Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a00627a authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki
Browse files

cpufreq: drivers: don't check range of target freq in .target()



Cpufreq core checks the range of target_freq before calling driver->target() and
so we don't need to do it again.

Remove it.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent e9f51837
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -79,15 +79,6 @@ static int davinci_target(struct cpufreq_policy *policy,
	struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
	struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
	struct clk *armclk = cpufreq.armclk;
	struct clk *armclk = cpufreq.armclk;


	/*
	 * Ensure desired rate is within allowed range.  Some govenors
	 * (ondemand) will just pass target_freq=0 to get the minimum.
	 */
	if (target_freq < policy->cpuinfo.min_freq)
		target_freq = policy->cpuinfo.min_freq;
	if (target_freq > policy->cpuinfo.max_freq)
		target_freq = policy->cpuinfo.max_freq;

	freqs.old = davinci_getspeed(0);
	freqs.old = davinci_getspeed(0);
	freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000;
	freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000;


+0 −6
Original line number Original line Diff line number Diff line
@@ -37,12 +37,6 @@ static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
	unsigned int idx;
	unsigned int idx;
	int ret;
	int ret;


	/* scale the target frequency to one of the extremes supported */
	if (target_freq < policy->cpuinfo.min_freq)
		target_freq = policy->cpuinfo.min_freq;
	if (target_freq > policy->cpuinfo.max_freq)
		target_freq = policy->cpuinfo.max_freq;

	/* Lookup the next frequency */
	/* Lookup the next frequency */
	if (cpufreq_frequency_table_target(policy, freq_table, target_freq,
	if (cpufreq_frequency_table_target(policy, freq_table, target_freq,
					relation, &idx))
					relation, &idx))