aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k7.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-k7.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-k7.c')
-rw-r--r--drivers/cpufreq/powernow-k7.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index 53888dacbe58..b9f80b713fda 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -186,7 +186,7 @@ static int get_ranges(unsigned char *pst)
186 fid = *pst++; 186 fid = *pst++;
187 187
188 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10; 188 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;
189 powernow_table[j].index = fid; /* lower 8 bits */ 189 powernow_table[j].driver_data = fid; /* lower 8 bits */
190 190
191 speed = powernow_table[j].frequency; 191 speed = powernow_table[j].frequency;
192 192
@@ -203,7 +203,7 @@ static int get_ranges(unsigned char *pst)
203 maximum_speed = speed; 203 maximum_speed = speed;
204 204
205 vid = *pst++; 205 vid = *pst++;
206 powernow_table[j].index |= (vid << 8); /* upper 8 bits */ 206 powernow_table[j].driver_data |= (vid << 8); /* upper 8 bits */
207 207
208 pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) " 208 pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) "
209 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 209 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
@@ -212,7 +212,7 @@ static int get_ranges(unsigned char *pst)
212 mobile_vid_table[vid]%1000); 212 mobile_vid_table[vid]%1000);
213 } 213 }
214 powernow_table[number_scales].frequency = CPUFREQ_TABLE_END; 214 powernow_table[number_scales].frequency = CPUFREQ_TABLE_END;
215 powernow_table[number_scales].index = 0; 215 powernow_table[number_scales].driver_data = 0;
216 216
217 return 0; 217 return 0;
218} 218}
@@ -260,8 +260,8 @@ static void change_speed(struct cpufreq_policy *policy, unsigned int index)
260 * vid are the upper 8 bits. 260 * vid are the upper 8 bits.
261 */ 261 */
262 262
263 fid = powernow_table[index].index & 0xFF; 263 fid = powernow_table[index].driver_data & 0xFF;
264 vid = (powernow_table[index].index & 0xFF00) >> 8; 264 vid = (powernow_table[index].driver_data & 0xFF00) >> 8;
265 265
266 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val); 266 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val);
267 cfid = fidvidstatus.bits.CFID; 267 cfid = fidvidstatus.bits.CFID;
@@ -373,8 +373,8 @@ static int powernow_acpi_init(void)
373 fid = pc.bits.fid; 373 fid = pc.bits.fid;
374 374
375 powernow_table[i].frequency = fsb * fid_codes[fid] / 10; 375 powernow_table[i].frequency = fsb * fid_codes[fid] / 10;
376 powernow_table[i].index = fid; /* lower 8 bits */ 376 powernow_table[i].driver_data = fid; /* lower 8 bits */
377 powernow_table[i].index |= (vid << 8); /* upper 8 bits */ 377 powernow_table[i].driver_data |= (vid << 8); /* upper 8 bits */
378 378
379 speed = powernow_table[i].frequency; 379 speed = powernow_table[i].frequency;
380 speed_mhz = speed / 1000; 380 speed_mhz = speed / 1000;
@@ -417,7 +417,7 @@ static int powernow_acpi_init(void)
417 } 417 }
418 418
419 powernow_table[i].frequency = CPUFREQ_TABLE_END; 419 powernow_table[i].frequency = CPUFREQ_TABLE_END;
420 powernow_table[i].index = 0; 420 powernow_table[i].driver_data = 0;
421 421
422 /* notify BIOS that we exist */ 422 /* notify BIOS that we exist */
423 acpi_processor_notify_smm(THIS_MODULE); 423 acpi_processor_notify_smm(THIS_MODULE);