lkml.org 
[lkml]   [2008]   [Feb]   [15]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
Subject[patch 6/6] Intel Menlow : extract return values using PTR_ERR
DateFri, 15 Feb 2008 10:55:47 +0530
From"Thomas, Sujith" <>
From: Thomas Sujith <sujith.thomas@intel.com>

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>
---
 drivers/misc/intel_menlow.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
Index: linux-2.6.24/drivers/misc/intel_menlow.c
===================================================================
--- linux-2.6.24.orig/drivers/misc/intel_menlow.c
+++ linux-2.6.24/drivers/misc/intel_menlow.c
@@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struc
 
 	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)[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2008-02-15 05:55    [from the cache]
©2003-2008