diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-05 20:49:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-05 20:49:01 -0500 |
commit | 9af6b056a281c81ae6043e0f5b4e2cb323f5bb43 (patch) | |
tree | 70249eb95e43bf450a2ab0e148dfb57329065a8e | |
parent | 8cce3e7cbe6f09553bfd94250f0a358ba669c8ac (diff) | |
parent | f6ebef30e21638417f8f5443ba393d63a0c27e2b (diff) |
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
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/e_powersaver.c | 8 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 20 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 2 |
3 files changed, 18 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c index 39f8cb18296c..c2f930d86640 100644 --- a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c +++ b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c | |||
@@ -55,7 +55,6 @@ static int eps_set_state(struct eps_cpu_data *centaur, | |||
55 | { | 55 | { |
56 | struct cpufreq_freqs freqs; | 56 | struct cpufreq_freqs freqs; |
57 | u32 lo, hi; | 57 | u32 lo, hi; |
58 | u8 current_multiplier, current_voltage; | ||
59 | int err = 0; | 58 | int err = 0; |
60 | int i; | 59 | int i; |
61 | 60 | ||
@@ -95,6 +94,10 @@ postchange: | |||
95 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); | 94 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); |
96 | freqs.new = centaur->fsb * ((lo >> 8) & 0xff); | 95 | freqs.new = centaur->fsb * ((lo >> 8) & 0xff); |
97 | 96 | ||
97 | #ifdef DEBUG | ||
98 | { | ||
99 | u8 current_multiplier, current_voltage; | ||
100 | |||
98 | /* Print voltage and multiplier */ | 101 | /* Print voltage and multiplier */ |
99 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); | 102 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); |
100 | current_voltage = lo & 0xff; | 103 | current_voltage = lo & 0xff; |
@@ -103,7 +106,8 @@ postchange: | |||
103 | current_multiplier = (lo >> 8) & 0xff; | 106 | current_multiplier = (lo >> 8) & 0xff; |
104 | printk(KERN_INFO "eps: Current multiplier = %d\n", | 107 | printk(KERN_INFO "eps: Current multiplier = %d\n", |
105 | current_multiplier); | 108 | current_multiplier); |
106 | 109 | } | |
110 | #endif | ||
107 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 111 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
108 | return err; | 112 | return err; |
109 | } | 113 | } |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 89a29cd93783..35a26a3e5f68 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -671,13 +671,13 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf) | |||
671 | { | 671 | { |
672 | struct cpufreq_policy * policy = to_policy(kobj); | 672 | struct cpufreq_policy * policy = to_policy(kobj); |
673 | struct freq_attr * fattr = to_attr(attr); | 673 | struct freq_attr * fattr = to_attr(attr); |
674 | ssize_t ret; | 674 | ssize_t ret = -EINVAL; |
675 | policy = cpufreq_cpu_get(policy->cpu); | 675 | policy = cpufreq_cpu_get(policy->cpu); |
676 | if (!policy) | 676 | if (!policy) |
677 | return -EINVAL; | 677 | goto no_policy; |
678 | 678 | ||
679 | if (lock_policy_rwsem_read(policy->cpu) < 0) | 679 | if (lock_policy_rwsem_read(policy->cpu) < 0) |
680 | return -EINVAL; | 680 | goto fail; |
681 | 681 | ||
682 | if (fattr->show) | 682 | if (fattr->show) |
683 | ret = fattr->show(policy, buf); | 683 | ret = fattr->show(policy, buf); |
@@ -685,8 +685,9 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf) | |||
685 | ret = -EIO; | 685 | ret = -EIO; |
686 | 686 | ||
687 | unlock_policy_rwsem_read(policy->cpu); | 687 | unlock_policy_rwsem_read(policy->cpu); |
688 | 688 | fail: | |
689 | cpufreq_cpu_put(policy); | 689 | cpufreq_cpu_put(policy); |
690 | no_policy: | ||
690 | return ret; | 691 | return ret; |
691 | } | 692 | } |
692 | 693 | ||
@@ -695,13 +696,13 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr, | |||
695 | { | 696 | { |
696 | struct cpufreq_policy * policy = to_policy(kobj); | 697 | struct cpufreq_policy * policy = to_policy(kobj); |
697 | struct freq_attr * fattr = to_attr(attr); | 698 | struct freq_attr * fattr = to_attr(attr); |
698 | ssize_t ret; | 699 | ssize_t ret = -EINVAL; |
699 | policy = cpufreq_cpu_get(policy->cpu); | 700 | policy = cpufreq_cpu_get(policy->cpu); |
700 | if (!policy) | 701 | if (!policy) |
701 | return -EINVAL; | 702 | goto no_policy; |
702 | 703 | ||
703 | if (lock_policy_rwsem_write(policy->cpu) < 0) | 704 | if (lock_policy_rwsem_write(policy->cpu) < 0) |
704 | return -EINVAL; | 705 | goto fail; |
705 | 706 | ||
706 | if (fattr->store) | 707 | if (fattr->store) |
707 | ret = fattr->store(policy, buf, count); | 708 | ret = fattr->store(policy, buf, count); |
@@ -709,8 +710,9 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr, | |||
709 | ret = -EIO; | 710 | ret = -EIO; |
710 | 711 | ||
711 | unlock_policy_rwsem_write(policy->cpu); | 712 | unlock_policy_rwsem_write(policy->cpu); |
712 | 713 | fail: | |
713 | cpufreq_cpu_put(policy); | 714 | cpufreq_cpu_put(policy); |
715 | no_policy: | ||
714 | return ret; | 716 | return ret; |
715 | } | 717 | } |
716 | 718 | ||
@@ -1775,7 +1777,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, | |||
1775 | return NOTIFY_OK; | 1777 | return NOTIFY_OK; |
1776 | } | 1778 | } |
1777 | 1779 | ||
1778 | static struct notifier_block __cpuinitdata cpufreq_cpu_notifier = | 1780 | static struct notifier_block __refdata cpufreq_cpu_notifier = |
1779 | { | 1781 | { |
1780 | .notifier_call = cpufreq_cpu_callback, | 1782 | .notifier_call = cpufreq_cpu_callback, |
1781 | }; | 1783 | }; |
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 1b8312b02006..070421a5480e 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, | |||
323 | return NOTIFY_OK; | 323 | return NOTIFY_OK; |
324 | } | 324 | } |
325 | 325 | ||
326 | static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata = | 326 | static struct notifier_block cpufreq_stat_cpu_notifier __refdata = |
327 | { | 327 | { |
328 | .notifier_call = cpufreq_stat_cpu_callback, | 328 | .notifier_call = cpufreq_stat_cpu_callback, |
329 | }; | 329 | }; |