* [PATCH] clk: bcm: kona: Stop defaulting to parent index 0 on error
@ 2026-05-31 13:18 Yu-Chun Lin
2026-06-01 15:57 ` Brian Masney
0 siblings, 1 reply; 2+ messages in thread
From: Yu-Chun Lin @ 2026-05-31 13:18 UTC (permalink / raw)
To: mturquette, sboyd, florian.fainelli, rjui, sbranden
Cc: bmasney, bcm-kernel-feedback-list, linux-clk, linux-kernel,
james.tai, cy.huang, stanley_chang, eleanor.lin
Stop defaulting to 0 on BAD_CLK_INDEX (U8_MAX). Passing the out-of-bounds
index directly allows the clk core to fail gracefully during parent
lookup.
Link: https://lore.kernel.org/lkml/177431305509.5403.15386021337517970667@lazor/
Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
---
drivers/clk/bcm/clk-kona.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c
index 0171e6b2bfca..d6f5872d7d6a 100644
--- a/drivers/clk/bcm/clk-kona.c
+++ b/drivers/clk/bcm/clk-kona.c
@@ -1098,8 +1098,7 @@ static u8 kona_peri_clk_get_parent(struct clk_hw *hw)
index = selector_read_index(bcm_clk->ccu, &data->sel);
- /* Not all callers would handle an out-of-range value gracefully */
- return index == BAD_CLK_INDEX ? 0 : index;
+ return index;
}
static int kona_peri_clk_set_rate(struct clk_hw *hw, unsigned long rate,
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: bcm: kona: Stop defaulting to parent index 0 on error
2026-05-31 13:18 [PATCH] clk: bcm: kona: Stop defaulting to parent index 0 on error Yu-Chun Lin
@ 2026-06-01 15:57 ` Brian Masney
0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2026-06-01 15:57 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: mturquette, sboyd, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, linux-clk, linux-kernel, james.tai,
cy.huang, stanley_chang
On Sun, May 31, 2026 at 09:18:25PM +0800, Yu-Chun Lin wrote:
> Stop defaulting to 0 on BAD_CLK_INDEX (U8_MAX). Passing the out-of-bounds
> index directly allows the clk core to fail gracefully during parent
> lookup.
>
> Link: https://lore.kernel.org/lkml/177431305509.5403.15386021337517970667@lazor/
> Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-01 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-31 13:18 [PATCH] clk: bcm: kona: Stop defaulting to parent index 0 on error Yu-Chun Lin
2026-06-01 15:57 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox