]> err.no Git - linux-2.6/blobdiff - drivers/misc/intel_menlow.c
olpc: sdhci: add quirk for the Marvell CaFe's vdd/powerup issue
[linux-2.6] / drivers / misc / intel_menlow.c
index 5bb8816c912688a0ffe85d3aa86b6aca80f4120c..80a1363524087a1e66e575058360d071bbca352f 100644 (file)
@@ -179,14 +179,22 @@ static int intel_menlow_memory_add(struct acpi_device *device)
        result = sysfs_create_link(&device->dev.kobj,
                                &cdev->device.kobj, "thermal_cooling");
        if (result)
-               printk(KERN_ERR PREFIX "Create sysfs link\n");
+               goto unregister;
+
        result = sysfs_create_link(&cdev->device.kobj,
                                &device->dev.kobj, "device");
-       if (result)
-               printk(KERN_ERR PREFIX "Create sysfs link\n");
+       if (result) {
+               sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+               goto unregister;
+       }
 
  end:
        return result;
+
+ unregister:
+       thermal_cooling_device_unregister(cdev);
+       return result;
+
 }
 
 static int intel_menlow_memory_remove(struct acpi_device *device, int type)