aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_core.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-06-22 16:41:19 -0400
committerLen Brown <len.brown@intel.com>2009-06-25 12:16:33 -0400
commit970b04929a68134acca17878b1d93e115e58c12a (patch)
tree068dd4b03992b9dda588d2d5e2c452adf60f2263 /drivers/acpi/processor_core.c
parentddcd62d89e8c919cc75aeffd2ca37c986141b0f0 (diff)
ACPI: processor: remove .start() method
This patch folds the .start() method into .add(). acpi_processor_start() is always called immediately after acpi_processor_add(), so there's really no point in having them be separate methods. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Reviewed-by: Alex Chiang <achiang@hp.com> CC: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> CC: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_core.c')
-rw-r--r--drivers/acpi/processor_core.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 53de55e6f6b..8014e2a3b26 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -79,7 +79,6 @@ MODULE_DESCRIPTION("ACPI Processor Driver");
79MODULE_LICENSE("GPL"); 79MODULE_LICENSE("GPL");
80 80
81static int acpi_processor_add(struct acpi_device *device); 81static int acpi_processor_add(struct acpi_device *device);
82static int acpi_processor_start(struct acpi_device *device);
83static int acpi_processor_remove(struct acpi_device *device, int type); 82static int acpi_processor_remove(struct acpi_device *device, int type);
84static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); 83static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
85static void acpi_processor_notify(struct acpi_device *device, u32 event); 84static void acpi_processor_notify(struct acpi_device *device, u32 event);
@@ -101,7 +100,6 @@ static struct acpi_driver acpi_processor_driver = {
101 .ops = { 100 .ops = {
102 .add = acpi_processor_add, 101 .add = acpi_processor_add,
103 .remove = acpi_processor_remove, 102 .remove = acpi_processor_remove,
104 .start = acpi_processor_start,
105 .suspend = acpi_processor_suspend, 103 .suspend = acpi_processor_suspend,
106 .resume = acpi_processor_resume, 104 .resume = acpi_processor_resume,
107 .notify = acpi_processor_notify, 105 .notify = acpi_processor_notify,
@@ -760,10 +758,8 @@ static struct notifier_block acpi_cpu_notifier =
760static int acpi_processor_add(struct acpi_device *device) 758static int acpi_processor_add(struct acpi_device *device)
761{ 759{
762 struct acpi_processor *pr = NULL; 760 struct acpi_processor *pr = NULL;
763 761 int result = 0;
764 762 struct sys_device *sysdev;
765 if (!device)
766 return -EINVAL;
767 763
768 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); 764 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
769 if (!pr) 765 if (!pr)
@@ -779,17 +775,6 @@ static int acpi_processor_add(struct acpi_device *device)
779 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); 775 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
780 device->driver_data = pr; 776 device->driver_data = pr;
781 777
782 return 0;
783}
784
785static int __cpuinit acpi_processor_start(struct acpi_device *device)
786{
787 int result = 0;
788 struct acpi_processor *pr;
789 struct sys_device *sysdev;
790
791 pr = acpi_driver_data(device);
792
793 result = acpi_processor_get_info(device); 778 result = acpi_processor_get_info(device);
794 if (result) { 779 if (result) {
795 /* Processor is physically not present */ 780 /* Processor is physically not present */
@@ -807,7 +792,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
807 per_cpu(processor_device_array, pr->id) != device) { 792 per_cpu(processor_device_array, pr->id) != device) {
808 printk(KERN_WARNING "BIOS reported wrong ACPI id " 793 printk(KERN_WARNING "BIOS reported wrong ACPI id "
809 "for the processor\n"); 794 "for the processor\n");
810 return -ENODEV; 795 result = -ENODEV;
796 goto err_free_cpumask;
811 } 797 }
812 per_cpu(processor_device_array, pr->id) = device; 798 per_cpu(processor_device_array, pr->id) = device;
813 799
@@ -815,7 +801,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
815 801
816 result = acpi_processor_add_fs(device); 802 result = acpi_processor_add_fs(device);
817 if (result) 803 if (result)
818 return result; 804 goto err_free_cpumask;
819 805
820 sysdev = get_cpu_sysdev(pr->id); 806 sysdev = get_cpu_sysdev(pr->id);
821 if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { 807 if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
@@ -879,6 +865,8 @@ err_power_exit:
879 acpi_processor_power_exit(pr, device); 865 acpi_processor_power_exit(pr, device);
880err_remove_fs: 866err_remove_fs:
881 acpi_processor_remove_fs(device); 867 acpi_processor_remove_fs(device);
868err_free_cpumask:
869 free_cpumask_var(pr->throttling.shared_cpu_map);
882 870
883 return result; 871 return result;
884} 872}
@@ -957,7 +945,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
957{ 945{
958 acpi_handle phandle; 946 acpi_handle phandle;
959 struct acpi_device *pdev; 947 struct acpi_device *pdev;
960 struct acpi_processor *pr;
961 948
962 949
963 if (acpi_get_parent(handle, &phandle)) { 950 if (acpi_get_parent(handle, &phandle)) {
@@ -972,12 +959,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
972 return -ENODEV; 959 return -ENODEV;
973 } 960 }
974 961
975 acpi_bus_start(*device);
976
977 pr = acpi_driver_data(*device);
978 if (!pr)
979 return -ENODEV;
980
981 return 0; 962 return 0;
982} 963}
983 964
@@ -1007,17 +988,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
1007 "Unable to add the device\n"); 988 "Unable to add the device\n");
1008 break; 989 break;
1009 } 990 }
1010
1011 pr = acpi_driver_data(device);
1012 if (!pr) {
1013 printk(KERN_ERR PREFIX "Driver data is NULL\n");
1014 break;
1015 }
1016
1017 result = acpi_processor_start(device);
1018 if (result)
1019 printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
1020 acpi_device_bid(device));
1021 break; 991 break;
1022 case ACPI_NOTIFY_EJECT_REQUEST: 992 case ACPI_NOTIFY_EJECT_REQUEST:
1023 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 993 ACPI_DEBUG_PRINT((ACPI_DB_INFO,