Browse Source

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>
Bjorn Helgaas 16 years ago
parent
commit
970b04929a
1 changed files with 7 additions and 37 deletions
  1. 7 37
      drivers/acpi/processor_core.c

+ 7 - 37
drivers/acpi/processor_core.c

@@ -79,7 +79,6 @@ MODULE_DESCRIPTION("ACPI Processor Driver");
 MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");
 
 
 static int acpi_processor_add(struct acpi_device *device);
 static int acpi_processor_add(struct acpi_device *device);
-static int acpi_processor_start(struct acpi_device *device);
 static int acpi_processor_remove(struct acpi_device *device, int type);
 static int acpi_processor_remove(struct acpi_device *device, int type);
 static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
 static void acpi_processor_notify(struct acpi_device *device, u32 event);
 static void acpi_processor_notify(struct acpi_device *device, u32 event);
@@ -101,7 +100,6 @@ static struct acpi_driver acpi_processor_driver = {
 	.ops = {
 	.ops = {
 		.add = acpi_processor_add,
 		.add = acpi_processor_add,
 		.remove = acpi_processor_remove,
 		.remove = acpi_processor_remove,
-		.start = acpi_processor_start,
 		.suspend = acpi_processor_suspend,
 		.suspend = acpi_processor_suspend,
 		.resume = acpi_processor_resume,
 		.resume = acpi_processor_resume,
 		.notify = acpi_processor_notify,
 		.notify = acpi_processor_notify,
@@ -760,10 +758,8 @@ static struct notifier_block acpi_cpu_notifier =
 static int acpi_processor_add(struct acpi_device *device)
 static int acpi_processor_add(struct acpi_device *device)
 {
 {
 	struct acpi_processor *pr = NULL;
 	struct acpi_processor *pr = NULL;
-
-
-	if (!device)
-		return -EINVAL;
+	int result = 0;
+	struct sys_device *sysdev;
 
 
 	pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
 	pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
 	if (!pr)
 	if (!pr)
@@ -779,17 +775,6 @@ static int acpi_processor_add(struct acpi_device *device)
 	strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
 	strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
 	device->driver_data = pr;
 	device->driver_data = pr;
 
 
-	return 0;
-}
-
-static int __cpuinit acpi_processor_start(struct acpi_device *device)
-{
-	int result = 0;
-	struct acpi_processor *pr;
-	struct sys_device *sysdev;
-
-	pr = acpi_driver_data(device);
-
 	result = acpi_processor_get_info(device);
 	result = acpi_processor_get_info(device);
 	if (result) {
 	if (result) {
 		/* Processor is physically not present */
 		/* Processor is physically not present */
@@ -807,7 +792,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
 	    per_cpu(processor_device_array, pr->id) != device) {
 	    per_cpu(processor_device_array, pr->id) != device) {
 		printk(KERN_WARNING "BIOS reported wrong ACPI id "
 		printk(KERN_WARNING "BIOS reported wrong ACPI id "
 			"for the processor\n");
 			"for the processor\n");
-		return -ENODEV;
+		result = -ENODEV;
+		goto err_free_cpumask;
 	}
 	}
 	per_cpu(processor_device_array, pr->id) = device;
 	per_cpu(processor_device_array, pr->id) = device;
 
 
@@ -815,7 +801,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
 
 
 	result = acpi_processor_add_fs(device);
 	result = acpi_processor_add_fs(device);
 	if (result)
 	if (result)
-		return result;
+		goto err_free_cpumask;
 
 
 	sysdev = get_cpu_sysdev(pr->id);
 	sysdev = get_cpu_sysdev(pr->id);
 	if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
 	if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
@@ -879,6 +865,8 @@ err_power_exit:
 	acpi_processor_power_exit(pr, device);
 	acpi_processor_power_exit(pr, device);
 err_remove_fs:
 err_remove_fs:
 	acpi_processor_remove_fs(device);
 	acpi_processor_remove_fs(device);
+err_free_cpumask:
+	free_cpumask_var(pr->throttling.shared_cpu_map);
 
 
 	return result;
 	return result;
 }
 }
@@ -957,7 +945,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
 {
 {
 	acpi_handle phandle;
 	acpi_handle phandle;
 	struct acpi_device *pdev;
 	struct acpi_device *pdev;
-	struct acpi_processor *pr;
 
 
 
 
 	if (acpi_get_parent(handle, &phandle)) {
 	if (acpi_get_parent(handle, &phandle)) {
@@ -972,12 +959,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
 		return -ENODEV;
 		return -ENODEV;
 	}
 	}
 
 
-	acpi_bus_start(*device);
-
-	pr = acpi_driver_data(*device);
-	if (!pr)
-		return -ENODEV;
-
 	return 0;
 	return 0;
 }
 }
 
 
@@ -1007,17 +988,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
 					    "Unable to add the device\n");
 					    "Unable to add the device\n");
 			break;
 			break;
 		}
 		}
-
-		pr = acpi_driver_data(device);
-		if (!pr) {
-			printk(KERN_ERR PREFIX "Driver data is NULL\n");
-			break;
-		}
-
-		result = acpi_processor_start(device);
-		if (result)
-			printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
-				    acpi_device_bid(device));
 		break;
 		break;
 	case ACPI_NOTIFY_EJECT_REQUEST:
 	case ACPI_NOTIFY_EJECT_REQUEST:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,