pr->cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops);
----- -- if (pr->cdev)
+++++ ++ if (IS_ERR(pr->cdev)) {
+++++ ++ result = PTR_ERR(pr->cdev);
+++++ ++ goto end;
+++++ ++ }
+++++ ++ if (pr->cdev) {
printk(KERN_INFO PREFIX
"%s is registered as cooling_device%d\n",
device->dev.bus_id, pr->cdev->id);
----- -- else
----- -- goto end;
----- -- result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj,
----- -- "thermal_cooling");
----- -- if (result)
----- -- return result;
----- -- result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj,
----- -- "device");
----- -- if (result)
----- -- return result;
+++++ ++ result = sysfs_create_link(&device->dev.kobj,
+++++ ++ &pr->cdev->device.kobj,
+++++ ++ "thermal_cooling");
+++++ ++ if (result)
+++++ ++ return result;
+++++ ++ result = sysfs_create_link(&pr->cdev->device.kobj,
+++++ ++ &device->dev.kobj,
+++++ ++ "device");
+++++ ++ if (result)
+++++ ++ return result;
+++++ ++ }
if (pr->flags.throttling) {
printk(KERN_INFO PREFIX "%s [%s] (supports",
acpi_processor_remove_fs(device);
- --- -- sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
- --- -- sysfs_remove_link(&pr->cdev->device.kobj, "device");
- --- -- thermal_cooling_device_unregister(pr->cdev);
- --- -- pr->cdev = NULL;
+ +++ ++ if (pr->cdev) {
+ +++ ++ sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+ +++ ++ sysfs_remove_link(&pr->cdev->device.kobj, "device");
+ +++ ++ thermal_cooling_device_unregister(pr->cdev);
+ +++ ++ pr->cdev = NULL;
+ +++ ++ }
processors[pr->id] = NULL;
* Acpi processor hotplug support *
****************************************************************************/
--- ----static int is_processor_present(acpi_handle handle);
--- ----
static int is_processor_present(acpi_handle handle)
{
acpi_status status;
/**
* __pci_osc_support_set - register OS support to Firmware
* @flags: OS support bits
+++ ++++ * @hid: hardware ID
*
* Update OS support fields and doing a _OSC Query to obtain an update
* from Firmware on supported control bits.
* choose from highest power _SxD to lowest power _SxW
* else // no _PRW at S-state x
* choose highest power _SxD or any lower power
---- --- *
---- --- * currently we simply return _SxD, if present.
*/
static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,