]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/processor_core.c
ACPI: elide a non-zero test on a result that is never 0
[linux-2.6-omap-h63xx.git] / drivers / acpi / processor_core.c
index a3cc8a98255cf724248c7efbf749a912bc9ef4f1..ea5f628dcc15d4430c1d8c8ce60635d9995e5cd4 100644 (file)
@@ -674,22 +674,21 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
                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);
-
-               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;
-       }
+
+       printk(KERN_INFO PREFIX
+               "%s is registered as cooling_device%d\n",
+               device->dev.bus_id, pr->cdev->id);
+
+       result = sysfs_create_link(&device->dev.kobj,
+                                  &pr->cdev->device.kobj,
+                                  "thermal_cooling");
+       if (result)
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
+       result = sysfs_create_link(&pr->cdev->device.kobj,
+                                  &device->dev.kobj,
+                                  "device");
+       if (result)
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
 
        if (pr->flags.throttling) {
                printk(KERN_INFO PREFIX "%s [%s] (supports",
@@ -822,7 +821,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
        }
 
        processors[pr->id] = NULL;
-
+       processor_device_array[pr->id] = NULL;
        kfree(pr);
 
        return 0;
@@ -840,17 +839,19 @@ static int is_processor_present(acpi_handle handle)
 
 
        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
-       /*
-        * if a processor object does not have an _STA object,
-        * OSPM assumes that the processor is present.
-        */
-       if (status == AE_NOT_FOUND)
-               return 1;
 
        if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT))
                return 1;
 
-       ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
+       /*
+        * _STA is mandatory for a processor that supports hot plug
+        */
+       if (status == AE_NOT_FOUND)
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                               "Processor does not support hot plug\n"));
+       else
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Processor Device is not present"));
        return 0;
 }
 
@@ -886,8 +887,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
        return 0;
 }
 
-static void
-acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
+static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
+                                               u32 event, void *data)
 {
        struct acpi_processor *pr;
        struct acpi_device *device = NULL;
@@ -897,9 +898,10 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
        switch (event) {
        case ACPI_NOTIFY_BUS_CHECK:
        case ACPI_NOTIFY_DEVICE_CHECK:
-               printk("Processor driver received %s event\n",
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+               "Processor driver received %s event\n",
                       (event == ACPI_NOTIFY_BUS_CHECK) ?
-                      "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
+                      "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"));
 
                if (!is_processor_present(handle))
                        break;