]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/fan.c
ACPI: elide a non-zero test on a result that is never 0
[linux-2.6-omap-h63xx.git] / drivers / acpi / fan.c
index f6e8165c32e8e6424e44f67b1dc028d221c91459..cf635cde836bba1d1cd288462eb3f0a3238a94a6 100644 (file)
@@ -256,22 +256,27 @@ static int acpi_fan_add(struct acpi_device *device)
 
        cdev = thermal_cooling_device_register("Fan", device,
                                                &fan_cooling_ops);
-       if (cdev)
-               printk(KERN_INFO PREFIX
-                       "%s is registered as cooling_device%d\n",
-                       device->dev.bus_id, cdev->id);
-       else
+       if (IS_ERR(cdev)) {
+               result = PTR_ERR(cdev);
                goto end;
+       }
+
+       printk(KERN_INFO PREFIX
+               "%s is registered as cooling_device%d\n",
+               device->dev.bus_id, cdev->id);
+
        acpi_driver_data(device) = cdev;
-       result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
-                                       "thermal_cooling");
+       result = sysfs_create_link(&device->dev.kobj,
+                                  &cdev->device.kobj,
+                                  "thermal_cooling");
        if (result)
-               return result;
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
 
-       result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj,
-                                       "device");
-        if (result)
-                return result;
+       result = sysfs_create_link(&cdev->device.kobj,
+                                  &device->dev.kobj,
+                                  "device");
+       if (result)
+               printk(KERN_ERR PREFIX "Create sysfs link\n");
 
        result = acpi_fan_add_fs(device);
        if (result)
@@ -337,10 +342,12 @@ static int __init acpi_fan_init(void)
        int result = 0;
 
 
+#ifdef CONFIG_ACPI_PROCFS
        acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
        if (!acpi_fan_dir)
                return -ENODEV;
        acpi_fan_dir->owner = THIS_MODULE;
+#endif
 
        result = acpi_bus_register_driver(&acpi_fan_driver);
        if (result < 0) {