diff options
author | Thomas Sujith <sujith.thomas@intel.com> | 2008-02-15 01:05:23 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-15 18:29:30 -0500 |
commit | 69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6 (patch) | |
tree | fc014952ab575afb4b63ca861c1697e54cb83b11 /drivers/misc/intel_menlow.c | |
parent | 43ff39f2f6450fa2e9a566f8bf007a26d76f2c9d (diff) | |
download | linux-69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6.tar.gz linux-69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6.tar.bz2 linux-69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6.zip |
intel_menlo: 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/misc/intel_menlow.c')
-rw-r--r-- | 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 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) 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) |