Revert "[CPUFREQ] Disable sysfs ui for p4-clockmod."

This reverts commit e088e4c9cdb618675874becb91b2fd581ee707e6.

Removing the sysfs interface for p4-clockmod was flagged as a
regression in bug 12826.

Course of action:
- Find out the remaining causes of overheating, and fix them
if possible. ACPI should be doing the right thing automatically.
If it isn't, we need to fix that.
- mark p4-clockmod ui as deprecated
- try again with the removal in six months.

It's not really feasible to printk about the deprecation, because
it needs to happen at all the sysfs entry points, which means adding
a lot of strcmp("p4-clockmod".. calls to the core, which.. bleuch.

Signed-off-by: Dave Jones <davej@redhat.com>

+18 -35
-1
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
··· 277 277 .name = "p4-clockmod", 278 278 .owner = THIS_MODULE, 279 279 .attr = p4clockmod_attr, 280 - .hide_interface = 1, 281 280 }; 282 281 283 282
+18 -33
drivers/cpufreq/cpufreq.c
··· 754 754 .release = cpufreq_sysfs_release, 755 755 }; 756 756 757 - static struct kobj_type ktype_empty_cpufreq = { 758 - .sysfs_ops = &sysfs_ops, 759 - .release = cpufreq_sysfs_release, 760 - }; 761 - 762 757 763 758 /** 764 759 * cpufreq_add_dev - add a CPU device ··· 887 892 memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); 888 893 889 894 /* prepare interface data */ 890 - if (!cpufreq_driver->hide_interface) { 891 - ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, 892 - &sys_dev->kobj, "cpufreq"); 895 + ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj, 896 + "cpufreq"); 897 + if (ret) 898 + goto err_out_driver_exit; 899 + 900 + /* set up files for this cpu device */ 901 + drv_attr = cpufreq_driver->attr; 902 + while ((drv_attr) && (*drv_attr)) { 903 + ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)); 893 904 if (ret) 894 905 goto err_out_driver_exit; 895 - 896 - /* set up files for this cpu device */ 897 - drv_attr = cpufreq_driver->attr; 898 - while ((drv_attr) && (*drv_attr)) { 899 - ret = sysfs_create_file(&policy->kobj, 900 - &((*drv_attr)->attr)); 901 - if (ret) 902 - goto err_out_driver_exit; 903 - drv_attr++; 904 - } 905 - if (cpufreq_driver->get) { 906 - ret = sysfs_create_file(&policy->kobj, 907 - &cpuinfo_cur_freq.attr); 908 - if (ret) 909 - goto err_out_driver_exit; 910 - } 911 - if (cpufreq_driver->target) { 912 - ret = sysfs_create_file(&policy->kobj, 913 - &scaling_cur_freq.attr); 914 - if (ret) 915 - goto err_out_driver_exit; 916 - } 917 - } else { 918 - ret = kobject_init_and_add(&policy->kobj, &ktype_empty_cpufreq, 919 - &sys_dev->kobj, "cpufreq"); 906 + drv_attr++; 907 + } 908 + if (cpufreq_driver->get) { 909 + ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr); 910 + if (ret) 911 + goto err_out_driver_exit; 912 + } 913 + if (cpufreq_driver->target) { 914 + ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr); 920 915 if (ret) 921 916 goto err_out_driver_exit; 922 917 }
-1
include/linux/cpufreq.h
··· 234 234 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 235 235 int (*resume) (struct cpufreq_policy *policy); 236 236 struct freq_attr **attr; 237 - bool hide_interface; 238 237 }; 239 238 240 239 /* flags */