From: Thomas Sujith <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/misc/intel_menlow.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index f70984a..de16e88 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)
 
        cdev = thermal_cooling_device_register("Memory controller", device,
                                               &memory_cooling_ops);
-       acpi_driver_data(device) = cdev;
-       if (!cdev)
-               result = -ENODEV;
-       else {
+       if (IS_ERR(cdev)) {
+               result = PTR_ERR(cdev);
+               goto end;
+       }
+
+       if (cdev) {
+               acpi_driver_data(device) = cdev;
                result = sysfs_create_link(&device->dev.kobj,
                                        &cdev->device.kobj, "thermal_cooling");
                if (result)
-- 
1.5.4

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to