aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Sujith <sujith.thomas@intel.com>2008-02-15 01:01:52 -0500
committerLen Brown <len.brown@intel.com>2008-02-15 18:21:30 -0500
commit19b36780ee7ddeb5080e3f1f858a83c4824f1fdc (patch)
tree88e854c9573fd61b0a78e01e1dd257cee4ce2c08 /drivers
parent3e6fda5c1159823fc02463eceb564c8bfc0e7a0e (diff)
ACPI fan: extract return values using PTR_ERR
Need to extract errors using PTR_ERR macro and process accordingly. thermal_cooling_device_register returning NULL means that CONFIG_THERMAL=n and in that case no need to create symbolic links. Signed-off-by: Thomas Sujith <sujith.thomas@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/fan.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 48cb705b274a..c8e3cba423ef 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -256,22 +256,28 @@ static int acpi_fan_add(struct acpi_device *device)
256 256
257 cdev = thermal_cooling_device_register("Fan", device, 257 cdev = thermal_cooling_device_register("Fan", device,
258 &fan_cooling_ops); 258 &fan_cooling_ops);
259 if (cdev) 259 if (IS_ERR(cdev)) {
260 result = PTR_ERR(cdev);
261 goto end;
262 }
263 if (cdev) {
260 printk(KERN_INFO PREFIX 264 printk(KERN_INFO PREFIX
261 "%s is registered as cooling_device%d\n", 265 "%s is registered as cooling_device%d\n",
262 device->dev.bus_id, cdev->id); 266 device->dev.bus_id, cdev->id);
263 else
264 goto end;
265 acpi_driver_data(device) = cdev;
266 result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
267 "thermal_cooling");
268 if (result)
269 return result;
270 267
271 result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj, 268 acpi_driver_data(device) = cdev;
272 "device"); 269 result = sysfs_create_link(&device->dev.kobj,
273 if (result) 270 &cdev->device.kobj,
274 return result; 271 "thermal_cooling");
272 if (result)
273 return result;
274
275 result = sysfs_create_link(&cdev->device.kobj,
276 &device->dev.kobj,
277 "device");
278 if (result)
279 return result;
280 }
275 281
276 result = acpi_fan_add_fs(device); 282 result = acpi_fan_add_fs(device);
277 if (result) 283 if (result)