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

Commit 965b8ca8 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: thermal: Handle min state clear condition properly"

parents ed9bfc53 9a6dc222
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt) "%s:%s " fmt, KBUILD_MODNAME, __func__
@@ -291,7 +291,7 @@ static int qmi_set_min_state(struct thermal_cooling_device *cdev,
		return 0;

	if (state > qmi_cdev->max_level)
		return -EINVAL;
		state = qmi_cdev->max_level;

	/* Convert state into QMI client expects for min state */
	state = qmi_cdev->max_level - state;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -92,7 +92,7 @@ static int reg_send_min_state(struct thermal_cooling_device *cdev,
	int ret = 0;

	if (state > REG_CDEV_MAX_STATE)
		return -EINVAL;
		state = REG_CDEV_MAX_STATE;

	if (reg_dev->min_state == state)
		return ret;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -47,7 +47,7 @@ static int reg_set_min_state(struct thermal_cooling_device *cdev,
	int ret = 0;

	if (state > reg_dev->lvl_ct)
		return -EINVAL;
		state = reg_dev->lvl_ct;

	if (reg_dev->min_reg_state == state)
		return ret;