]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/intel_menlow.c
ACPI: elide a non-zero test on a result that is never 0
[linux-2.6-omap-h63xx.git] / drivers / misc / intel_menlow.c
index f70984ab1e1bdfd2c1aa25a32108f6b96117f83b..3db83a2dc3a1fc76f72bd87b26c77cb2493a0cdb 100644 (file)
@@ -170,23 +170,21 @@ static int intel_menlow_memory_add(struct acpi_device *device)
 
        cdev = thermal_cooling_device_register("Memory controller", device,
                                               &memory_cooling_ops);
-       acpi_driver_data(device) = cdev;
-       if (!cdev)
-               result = -ENODEV;
-       else {
-               result = sysfs_create_link(&device->dev.kobj,
-                                       &cdev->device.kobj, "thermal_cooling");
-               if (result)
-                       goto unregister;
-
-               result = sysfs_create_link(&cdev->device.kobj,
-                                       &device->dev.kobj, "device");
-               if (result) {
-                       sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
-                       goto unregister;
-               }
+       if (IS_ERR(cdev)) {
+               result = PTR_ERR(cdev);
+               goto end;
        }
 
+       acpi_driver_data(device) = cdev;
+       result = sysfs_create_link(&device->dev.kobj,
+                               &cdev->device.kobj, "thermal_cooling");
+       if (result)
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
+       result = sysfs_create_link(&cdev->device.kobj,
+                               &device->dev.kobj, "device");
+       if (result)
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
+
  end:
        return result;
 
@@ -210,7 +208,7 @@ static int intel_menlow_memory_remove(struct acpi_device *device, int type)
        return 0;
 }
 
-const static struct acpi_device_id intel_menlow_memory_ids[] = {
+static const struct acpi_device_id intel_menlow_memory_ids[] = {
        {"INT0002", 0},
        {"", 0},
 };