diff options
| -rw-r--r-- | drivers/acpi/processor_core.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 75ccf5d18bf4..b02006951cd0 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
| @@ -670,21 +670,26 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) | |||
| 670 | 670 | ||
| 671 | pr->cdev = thermal_cooling_device_register("Processor", device, | 671 | pr->cdev = thermal_cooling_device_register("Processor", device, |
| 672 | &processor_cooling_ops); | 672 | &processor_cooling_ops); |
| 673 | if (pr->cdev) | 673 | if (IS_ERR(pr->cdev)) { |
| 674 | result = PTR_ERR(pr->cdev); | ||
| 675 | goto end; | ||
| 676 | } | ||
| 677 | if (pr->cdev) { | ||
| 674 | printk(KERN_INFO PREFIX | 678 | printk(KERN_INFO PREFIX |
| 675 | "%s is registered as cooling_device%d\n", | 679 | "%s is registered as cooling_device%d\n", |
| 676 | device->dev.bus_id, pr->cdev->id); | 680 | device->dev.bus_id, pr->cdev->id); |
| 677 | else | ||
| 678 | goto end; | ||
| 679 | 681 | ||
| 680 | result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj, | 682 | result = sysfs_create_link(&device->dev.kobj, |
| 681 | "thermal_cooling"); | 683 | &pr->cdev->device.kobj, |
| 682 | if (result) | 684 | "thermal_cooling"); |
| 683 | return result; | 685 | if (result) |
| 684 | result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj, | 686 | return result; |
| 685 | "device"); | 687 | result = sysfs_create_link(&pr->cdev->device.kobj, |
| 686 | if (result) | 688 | &device->dev.kobj, |
| 687 | return result; | 689 | "device"); |
| 690 | if (result) | ||
| 691 | return result; | ||
| 692 | } | ||
| 688 | 693 | ||
| 689 | if (pr->flags.throttling) { | 694 | if (pr->flags.throttling) { |
| 690 | printk(KERN_INFO PREFIX "%s [%s] (supports", | 695 | printk(KERN_INFO PREFIX "%s [%s] (supports", |
| @@ -809,10 +814,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type) | |||
| 809 | 814 | ||
| 810 | acpi_processor_remove_fs(device); | 815 | acpi_processor_remove_fs(device); |
| 811 | 816 | ||
| 812 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); | 817 | if (pr->cdev) { |
| 813 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); | 818 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); |
| 814 | thermal_cooling_device_unregister(pr->cdev); | 819 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); |
| 815 | pr->cdev = NULL; | 820 | thermal_cooling_device_unregister(pr->cdev); |
| 821 | pr->cdev = NULL; | ||
| 822 | } | ||
| 816 | 823 | ||
| 817 | processors[pr->id] = NULL; | 824 | processors[pr->id] = NULL; |
| 818 | 825 | ||
