mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
clk: bcm: kona: Stop defaulting to parent index 0 on error
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> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
d4d0d335e8
commit
483932d86b
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user