[PATCH] interconnect: icc-clk: clear enabled flag only when it is set

Gabor Juhos posted 1 patch 2 months, 3 weeks ago
drivers/interconnect/icc-clk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] interconnect: icc-clk: clear enabled flag only when it is set
Posted by Gabor Juhos 2 months, 3 weeks ago
It is pointless to clear the enabled flag when it is cleared already, so
change the code to do that only when the flag is set.

Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
 drivers/interconnect/icc-clk.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/interconnect/icc-clk.c b/drivers/interconnect/icc-clk.c
index 93c030608d3e0aad7d9c1ed81a51dcde0d3f85ab..6bbafe8fc6bdf6c036eafab6db8b68687611d6b6 100644
--- a/drivers/interconnect/icc-clk.c
+++ b/drivers/interconnect/icc-clk.c
@@ -31,9 +31,10 @@ static int icc_clk_set(struct icc_node *src, struct icc_node *dst)
 		return 0;
 
 	if (!src->peak_bw) {
-		if (qn->enabled)
+		if (qn->enabled) {
 			clk_disable_unprepare(qn->clk);
-		qn->enabled = false;
+			qn->enabled = false;
+		}
 
 		return 0;
 	}

---
base-commit: 41aa8dd5b19c447686b68e6730d348ecc0373143
change-id: 20251027-icc-clk-disable-cleanup-5468c1d8eb0e

Best regards,
-- 
Gabor Juhos <j4g8y7@gmail.com>