aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/intel_menlow.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/intel_menlow.c')
-rw-r--r--drivers/misc/intel_menlow.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index f70984ab1e1b..de16e88eb8d3 100644
--- a/drivers/misc/intel_menlow.c
+++ b/drivers/misc/intel_menlow.c
@@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struct acpi_device *device)
170 170
171 cdev = thermal_cooling_device_register("Memory controller", device, 171 cdev = thermal_cooling_device_register("Memory controller", device,
172 &memory_cooling_ops); 172 &memory_cooling_ops);
173 acpi_driver_data(device) = cdev; 173 if (IS_ERR(cdev)) {
174 if (!cdev) 174 result = PTR_ERR(cdev);
175 result = -ENODEV; 175 goto end;
176 else { 176 }
177
178 if (cdev) {
179 acpi_driver_data(device) = cdev;
177 result = sysfs_create_link(&device->dev.kobj, 180 result = sysfs_create_link(&device->dev.kobj,
178 &cdev->device.kobj, "thermal_cooling"); 181 &cdev->device.kobj, "thermal_cooling");
179 if (result) 182 if (result)