Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351013
b: refs/heads/master
c: d5aaffa
h: refs/heads/master
i:
  351011: 1f04da8
v: v3
  • Loading branch information
Dirk Brandewie authored and Rafael J. Wysocki committed Feb 1, 2013
1 parent 32e05b6 commit cc5b1f4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8eed8af94f9203e0cc39245ea335f4b8dc1ed31
refs/heads/master: d5aaffa9dd531c978c6f3fea06a2972653bd7fc8
18 changes: 18 additions & 0 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ static struct cpufreq_policy *__cpufreq_cpu_get(unsigned int cpu, bool sysfs)

struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
{
if (cpufreq_disabled())
return NULL;

return __cpufreq_cpu_get(cpu, false);
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
Expand All @@ -201,6 +204,9 @@ static void __cpufreq_cpu_put(struct cpufreq_policy *data, bool sysfs)

void cpufreq_cpu_put(struct cpufreq_policy *data)
{
if (cpufreq_disabled())
return;

__cpufreq_cpu_put(data, false);
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
Expand Down Expand Up @@ -267,6 +273,9 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)

BUG_ON(irqs_disabled());

if (cpufreq_disabled())
return;

freqs->flags = cpufreq_driver->flags;
pr_debug("notification %u of frequency transition to %u kHz\n",
state, freqs->new);
Expand Down Expand Up @@ -1408,6 +1417,9 @@ int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list)
{
int ret;

if (cpufreq_disabled())
return -EINVAL;

WARN_ON(!init_cpufreq_transition_notifier_list_called);

switch (list) {
Expand Down Expand Up @@ -1442,6 +1454,9 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list)
{
int ret;

if (cpufreq_disabled())
return -EINVAL;

switch (list) {
case CPUFREQ_TRANSITION_NOTIFIER:
ret = srcu_notifier_chain_unregister(
Expand Down Expand Up @@ -1522,6 +1537,9 @@ int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
{
int ret = 0;

if (cpufreq_disabled())
return ret;

if (!(cpu_online(cpu) && cpufreq_driver->getavg))
return 0;

Expand Down

0 comments on commit cc5b1f4

Please sign in to comment.