mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
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>
This commit is contained in:
parent
43ff39f2f6
commit
69f6b8dd6b
1 changed files with 7 additions and 4 deletions
|
@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struct acpi_device *device)
|
||||||
|
|
||||||
cdev = thermal_cooling_device_register("Memory controller", device,
|
cdev = thermal_cooling_device_register("Memory controller", device,
|
||||||
&memory_cooling_ops);
|
&memory_cooling_ops);
|
||||||
|
if (IS_ERR(cdev)) {
|
||||||
|
result = PTR_ERR(cdev);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cdev) {
|
||||||
acpi_driver_data(device) = cdev;
|
acpi_driver_data(device) = cdev;
|
||||||
if (!cdev)
|
|
||||||
result = -ENODEV;
|
|
||||||
else {
|
|
||||||
result = sysfs_create_link(&device->dev.kobj,
|
result = sysfs_create_link(&device->dev.kobj,
|
||||||
&cdev->device.kobj, "thermal_cooling");
|
&cdev->device.kobj, "thermal_cooling");
|
||||||
if (result)
|
if (result)
|
||||||
|
|
Loading…
Reference in a new issue