aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/processor_core.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index c6ec68d4f16..a496a863ede 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -731,11 +731,13 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
731 731
732 result = acpi_processor_add_fs(device); 732 result = acpi_processor_add_fs(device);
733 if (result) 733 if (result)
734 goto end; 734 return result;
735 735
736 sysdev = get_cpu_sysdev(pr->id); 736 sysdev = get_cpu_sysdev(pr->id);
737 if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) 737 if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
738 return -EFAULT; 738 result = -EFAULT;
739 goto err_remove_fs;
740 }
739 741
740 /* _PDC call should be done before doing anything else (if reqd.). */ 742 /* _PDC call should be done before doing anything else (if reqd.). */
741 arch_acpi_processor_init_pdc(pr); 743 arch_acpi_processor_init_pdc(pr);
@@ -755,7 +757,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
755 &processor_cooling_ops); 757 &processor_cooling_ops);
756 if (IS_ERR(pr->cdev)) { 758 if (IS_ERR(pr->cdev)) {
757 result = PTR_ERR(pr->cdev); 759 result = PTR_ERR(pr->cdev);
758 goto end; 760 goto err_power_exit;
759 } 761 }
760 762
761 dev_info(&device->dev, "registered as cooling_device%d\n", 763 dev_info(&device->dev, "registered as cooling_device%d\n",
@@ -764,13 +766,17 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
764 result = sysfs_create_link(&device->dev.kobj, 766 result = sysfs_create_link(&device->dev.kobj,
765 &pr->cdev->device.kobj, 767 &pr->cdev->device.kobj,
766 "thermal_cooling"); 768 "thermal_cooling");
767 if (result) 769 if (result) {
768 printk(KERN_ERR PREFIX "Create sysfs link\n"); 770 printk(KERN_ERR PREFIX "Create sysfs link\n");
771 goto err_thermal_unregister;
772 }
769 result = sysfs_create_link(&pr->cdev->device.kobj, 773 result = sysfs_create_link(&pr->cdev->device.kobj,
770 &device->dev.kobj, 774 &device->dev.kobj,
771 "device"); 775 "device");
772 if (result) 776 if (result) {
773 printk(KERN_ERR PREFIX "Create sysfs link\n"); 777 printk(KERN_ERR PREFIX "Create sysfs link\n");
778 goto err_remove_sysfs;
779 }
774 780
775 if (pr->flags.throttling) { 781 if (pr->flags.throttling) {
776 printk(KERN_INFO PREFIX "%s [%s] (supports", 782 printk(KERN_INFO PREFIX "%s [%s] (supports",
@@ -779,7 +785,16 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
779 printk(")\n"); 785 printk(")\n");
780 } 786 }
781 787
782 end: 788 return 0;
789
790err_remove_sysfs:
791 sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
792err_thermal_unregister:
793 thermal_cooling_device_unregister(pr->cdev);
794err_power_exit:
795 acpi_processor_power_exit(pr, device);
796err_remove_fs:
797 acpi_processor_remove_fs(device);
783 798
784 return result; 799 return result;
785} 800}