Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69f6b8dd authored by Thomas Sujith's avatar Thomas Sujith Committed by Len Brown
Browse files

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: default avatarThomas Sujith <sujith.thomas@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 43ff39f2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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);
	if (IS_ERR(cdev)) {
		result = PTR_ERR(cdev);
		goto end;
	}

	if (cdev) {
		acpi_driver_data(device) = cdev;
	if (!cdev)
		result = -ENODEV;
	else {
		result = sysfs_create_link(&device->dev.kobj,
					&cdev->device.kobj, "thermal_cooling");
		if (result)