提交 69f6b8dd 编写于 作者: T Thomas Sujith 提交者: Len Brown

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: NThomas Sujith <sujith.thomas@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 43ff39f2
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册