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;