Skip to content

Commit

Permalink
Merge branch 'fixes-25' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/davej/cpufreq

* 'fixes-25' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] fix section mismatch warnings
  [CPUFREQ] Remove debugging message from e_powersaver
  [CPUFREQ] Fix missing cpufreq_cpu_put() call in ->store
  [CPUFREQ] Fix missing cpufreq_cpu_put() call in ->show
  • Loading branch information
Linus Torvalds committed Mar 6, 2008
2 parents 8cce3e7 + f6ebef3 commit 9af6b05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 6 additions & 2 deletions arch/x86/kernel/cpu/cpufreq/e_powersaver.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static int eps_set_state(struct eps_cpu_data *centaur,
{
struct cpufreq_freqs freqs;
u32 lo, hi;
u8 current_multiplier, current_voltage;
int err = 0;
int i;

Expand Down Expand Up @@ -95,6 +94,10 @@ static int eps_set_state(struct eps_cpu_data *centaur,
rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
freqs.new = centaur->fsb * ((lo >> 8) & 0xff);

#ifdef DEBUG
{
u8 current_multiplier, current_voltage;

/* Print voltage and multiplier */
rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
current_voltage = lo & 0xff;
Expand All @@ -103,7 +106,8 @@ static int eps_set_state(struct eps_cpu_data *centaur,
current_multiplier = (lo >> 8) & 0xff;
printk(KERN_INFO "eps: Current multiplier = %d\n",
current_multiplier);

}
#endif
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return err;
}
Expand Down
20 changes: 11 additions & 9 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,23 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
{
struct cpufreq_policy * policy = to_policy(kobj);
struct freq_attr * fattr = to_attr(attr);
ssize_t ret;
ssize_t ret = -EINVAL;
policy = cpufreq_cpu_get(policy->cpu);
if (!policy)
return -EINVAL;
goto no_policy;

if (lock_policy_rwsem_read(policy->cpu) < 0)
return -EINVAL;
goto fail;

if (fattr->show)
ret = fattr->show(policy, buf);
else
ret = -EIO;

unlock_policy_rwsem_read(policy->cpu);

fail:
cpufreq_cpu_put(policy);
no_policy:
return ret;
}

Expand All @@ -695,22 +696,23 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
{
struct cpufreq_policy * policy = to_policy(kobj);
struct freq_attr * fattr = to_attr(attr);
ssize_t ret;
ssize_t ret = -EINVAL;
policy = cpufreq_cpu_get(policy->cpu);
if (!policy)
return -EINVAL;
goto no_policy;

if (lock_policy_rwsem_write(policy->cpu) < 0)
return -EINVAL;
goto fail;

if (fattr->store)
ret = fattr->store(policy, buf, count);
else
ret = -EIO;

unlock_policy_rwsem_write(policy->cpu);

fail:
cpufreq_cpu_put(policy);
no_policy:
return ret;
}

Expand Down Expand Up @@ -1775,7 +1777,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
static struct notifier_block __refdata cpufreq_cpu_notifier =
{
.notifier_call = cpufreq_cpu_callback,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/cpufreq_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
{
.notifier_call = cpufreq_stat_cpu_callback,
};
Expand Down

0 comments on commit 9af6b05

Please sign in to comment.