Merge branch 'fixes-25' of git://git.kernel.org/pub/scm/linux/kernel/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
This commit is contained in:
Linus Torvalds 2008-03-05 17:49:01 -08:00
commit 9af6b056a2
3 changed files with 18 additions and 12 deletions

View file

@ -55,7 +55,6 @@ static int eps_set_state(struct eps_cpu_data *centaur,
{ {
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
u32 lo, hi; u32 lo, hi;
u8 current_multiplier, current_voltage;
int err = 0; int err = 0;
int i; int i;
@ -95,6 +94,10 @@ postchange:
rdmsr(MSR_IA32_PERF_STATUS, lo, hi); rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
freqs.new = centaur->fsb * ((lo >> 8) & 0xff); freqs.new = centaur->fsb * ((lo >> 8) & 0xff);
#ifdef DEBUG
{
u8 current_multiplier, current_voltage;
/* Print voltage and multiplier */ /* Print voltage and multiplier */
rdmsr(MSR_IA32_PERF_STATUS, lo, hi); rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
current_voltage = lo & 0xff; current_voltage = lo & 0xff;
@ -103,7 +106,8 @@ postchange:
current_multiplier = (lo >> 8) & 0xff; current_multiplier = (lo >> 8) & 0xff;
printk(KERN_INFO "eps: Current multiplier = %d\n", printk(KERN_INFO "eps: Current multiplier = %d\n",
current_multiplier); current_multiplier);
}
#endif
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return err; return err;
} }

View file

@ -671,13 +671,13 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
{ {
struct cpufreq_policy * policy = to_policy(kobj); struct cpufreq_policy * policy = to_policy(kobj);
struct freq_attr * fattr = to_attr(attr); struct freq_attr * fattr = to_attr(attr);
ssize_t ret; ssize_t ret = -EINVAL;
policy = cpufreq_cpu_get(policy->cpu); policy = cpufreq_cpu_get(policy->cpu);
if (!policy) if (!policy)
return -EINVAL; goto no_policy;
if (lock_policy_rwsem_read(policy->cpu) < 0) if (lock_policy_rwsem_read(policy->cpu) < 0)
return -EINVAL; goto fail;
if (fattr->show) if (fattr->show)
ret = fattr->show(policy, buf); ret = fattr->show(policy, buf);
@ -685,8 +685,9 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
ret = -EIO; ret = -EIO;
unlock_policy_rwsem_read(policy->cpu); unlock_policy_rwsem_read(policy->cpu);
fail:
cpufreq_cpu_put(policy); cpufreq_cpu_put(policy);
no_policy:
return ret; return ret;
} }
@ -695,13 +696,13 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
{ {
struct cpufreq_policy * policy = to_policy(kobj); struct cpufreq_policy * policy = to_policy(kobj);
struct freq_attr * fattr = to_attr(attr); struct freq_attr * fattr = to_attr(attr);
ssize_t ret; ssize_t ret = -EINVAL;
policy = cpufreq_cpu_get(policy->cpu); policy = cpufreq_cpu_get(policy->cpu);
if (!policy) if (!policy)
return -EINVAL; goto no_policy;
if (lock_policy_rwsem_write(policy->cpu) < 0) if (lock_policy_rwsem_write(policy->cpu) < 0)
return -EINVAL; goto fail;
if (fattr->store) if (fattr->store)
ret = fattr->store(policy, buf, count); ret = fattr->store(policy, buf, count);
@ -709,8 +710,9 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
ret = -EIO; ret = -EIO;
unlock_policy_rwsem_write(policy->cpu); unlock_policy_rwsem_write(policy->cpu);
fail:
cpufreq_cpu_put(policy); cpufreq_cpu_put(policy);
no_policy:
return ret; return ret;
} }
@ -1775,7 +1777,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK; return NOTIFY_OK;
} }
static struct notifier_block __cpuinitdata cpufreq_cpu_notifier = static struct notifier_block __refdata cpufreq_cpu_notifier =
{ {
.notifier_call = cpufreq_cpu_callback, .notifier_call = cpufreq_cpu_callback,
}; };

View file

@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK; 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, .notifier_call = cpufreq_stat_cpu_callback,
}; };