]> Pileus Git - ~andy/linux/blobdiff - drivers/misc/intel_menlow.c
asus-laptop: Add support for P30/P35
[~andy/linux] / drivers / misc / intel_menlow.c
index 3db83a2dc3a1fc76f72bd87b26c77cb2493a0cdb..cd3ea7faa5b6bd4cf55d3bd2ec2c2c0436f0ae41 100644 (file)
@@ -175,15 +175,18 @@ static int intel_menlow_memory_add(struct acpi_device *device)
                goto end;
        }
 
-       acpi_driver_data(device) = cdev;
+       device->driver_data = cdev;
        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;