]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: rockchip: fix finding of maximum clock ID
authorYao Zi <ziyao@disroot.org>
Thu, 12 Sep 2024 13:32:05 +0000 (13:32 +0000)
committerStephen Boyd <sboyd@kernel.org>
Wed, 9 Oct 2024 23:06:51 +0000 (16:06 -0700)
If an ID of a branch's child is greater than current maximum, we should
set new maximum to the child's ID, instead of its parent's.

Fixes: 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")
Signed-off-by: Yao Zi <ziyao@disroot.org>
Link: https://lore.kernel.org/r/20240912133204.29089-2-ziyao@disroot.org
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/rockchip/clk.c

index 2fa7253c73b2cdfc5b8c9f73539eb7250be8897b..88629a9abc9c90905324c458731ee3457933c59c 100644 (file)
@@ -439,7 +439,7 @@ unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list,
                if (list->id > max)
                        max = list->id;
                if (list->child && list->child->id > max)
-                       max = list->id;
+                       max = list->child->id;
        }
 
        return max;