]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/intel_menlow.c
intel_menlo: extract return values using PTR_ERR
[linux-2.6-omap-h63xx.git] / drivers / misc / intel_menlow.c
index f70984ab1e1bdfd2c1aa25a32108f6b96117f83b..de16e88eb8d3d89785fdefce12a7953c878bb0c6 100644 (file)
@@ -170,10 +170,13 @@ 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 {
+       if (IS_ERR(cdev)) {
+               result = PTR_ERR(cdev);
+               goto end;
+       }
+
+       if (cdev) {
+               acpi_driver_data(device) = cdev;
                result = sysfs_create_link(&device->dev.kobj,
                                        &cdev->device.kobj, "thermal_cooling");
                if (result)