summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k8.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-03-30 06:55:15 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-04 08:25:59 -0400
commit5070158804b5339c71809f5e673cea1cfacd804d (patch)
tree42256e81e326af4e568a179787e66d434a0b1ffc /drivers/cpufreq/powernow-k8.c
parent2361be23666232dbb4851a527f466c4cbf5340fc (diff)
cpufreq: rename index as driver_data in cpufreq_frequency_table
The "index" field of struct cpufreq_frequency_table was never an index and isn't used at all by the cpufreq core. It only is useful for cpufreq drivers for their internal purposes. Many people nowadays blindly set it in ascending order with the assumption that the core will use it, which is a mistake. Rename it to "driver_data" as that's what its purpose is. All of its users are updated accordingly. [rjw: Changelog] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/powernow-k8.c')
-rw-r--r--drivers/cpufreq/powernow-k8.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index b828efe4b2f8..51343a128703 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -584,9 +584,9 @@ static void print_basics(struct powernow_k8_data *data)
584 CPUFREQ_ENTRY_INVALID) { 584 CPUFREQ_ENTRY_INVALID) {
585 printk(KERN_INFO PFX 585 printk(KERN_INFO PFX
586 "fid 0x%x (%d MHz), vid 0x%x\n", 586 "fid 0x%x (%d MHz), vid 0x%x\n",
587 data->powernow_table[j].index & 0xff, 587 data->powernow_table[j].driver_data & 0xff,
588 data->powernow_table[j].frequency/1000, 588 data->powernow_table[j].frequency/1000,
589 data->powernow_table[j].index >> 8); 589 data->powernow_table[j].driver_data >> 8);
590 } 590 }
591 } 591 }
592 if (data->batps) 592 if (data->batps)
@@ -632,13 +632,13 @@ static int fill_powernow_table(struct powernow_k8_data *data,
632 632
633 for (j = 0; j < data->numps; j++) { 633 for (j = 0; j < data->numps; j++) {
634 int freq; 634 int freq;
635 powernow_table[j].index = pst[j].fid; /* lower 8 bits */ 635 powernow_table[j].driver_data = pst[j].fid; /* lower 8 bits */
636 powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */ 636 powernow_table[j].driver_data |= (pst[j].vid << 8); /* upper 8 bits */
637 freq = find_khz_freq_from_fid(pst[j].fid); 637 freq = find_khz_freq_from_fid(pst[j].fid);
638 powernow_table[j].frequency = freq; 638 powernow_table[j].frequency = freq;
639 } 639 }
640 powernow_table[data->numps].frequency = CPUFREQ_TABLE_END; 640 powernow_table[data->numps].frequency = CPUFREQ_TABLE_END;
641 powernow_table[data->numps].index = 0; 641 powernow_table[data->numps].driver_data = 0;
642 642
643 if (query_current_values_with_pending_wait(data)) { 643 if (query_current_values_with_pending_wait(data)) {
644 kfree(powernow_table); 644 kfree(powernow_table);
@@ -810,7 +810,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
810 810
811 powernow_table[data->acpi_data.state_count].frequency = 811 powernow_table[data->acpi_data.state_count].frequency =
812 CPUFREQ_TABLE_END; 812 CPUFREQ_TABLE_END;
813 powernow_table[data->acpi_data.state_count].index = 0; 813 powernow_table[data->acpi_data.state_count].driver_data = 0;
814 data->powernow_table = powernow_table; 814 data->powernow_table = powernow_table;
815 815
816 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) 816 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
@@ -865,7 +865,7 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
865 pr_debug(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 865 pr_debug(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
866 866
867 index = fid | (vid<<8); 867 index = fid | (vid<<8);
868 powernow_table[i].index = index; 868 powernow_table[i].driver_data = index;
869 869
870 freq = find_khz_freq_from_fid(fid); 870 freq = find_khz_freq_from_fid(fid);
871 powernow_table[i].frequency = freq; 871 powernow_table[i].frequency = freq;
@@ -941,8 +941,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
941 * the cpufreq frequency table in find_psb_table, vid 941 * the cpufreq frequency table in find_psb_table, vid
942 * are the upper 8 bits. 942 * are the upper 8 bits.
943 */ 943 */
944 fid = data->powernow_table[index].index & 0xFF; 944 fid = data->powernow_table[index].driver_data & 0xFF;
945 vid = (data->powernow_table[index].index & 0xFF00) >> 8; 945 vid = (data->powernow_table[index].driver_data & 0xFF00) >> 8;
946 946
947 pr_debug("table matched fid 0x%x, giving vid 0x%x\n", fid, vid); 947 pr_debug("table matched fid 0x%x, giving vid 0x%x\n", fid, vid);
948 948