Commit cd3c4670 authored by Alok Tiwari's avatar Alok Tiwari Committed by Bjorn Andersson
Browse files

soc: qcom: aoss: compare against normalized cooling state



qmp_cdev_set_cur_state() normalizes the requested state to a boolean
(cdev_state = !!state). The existing early-return check compares
qmp_cdev->state == state, which can be wrong if state is non-boolean
(any non-zero value). Compare qmp_cdev->state against cdev_state instead,
so the check matches the effective state and avoids redundant updates.

Signed-off-by: default avatarAlok Tiwari <alok.a.tiwari@oracle.com>
Fixes: 05589b30 ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.")
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260329195333.1478090-1-alok.a.tiwari@oracle.com


Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 24e7625d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
	/* Normalize state */
	cdev_state = !!state;

	if (qmp_cdev->state == state)
	if (qmp_cdev->state == cdev_state)
		return 0;

	ret = qmp_send(qmp_cdev->qmp, "{class: volt_flr, event:zero_temp, res:%s, value:%s}",