Thread (4 messages) 4 messages, 4 authors, 2026-03-25

Re: [PATCH] clk: uniphier: mux: fix signedness bug in get_parent

From: Stephen Boyd <sboyd@kernel.org>
Date: 2026-03-24 00:44:17
Also in: linux-clk, lkml

Quoting Anas Iqbal (2026-03-18 04:02:51)
The uniphier_clk_mux_get_parent() function returns a u8, but
propagates negative error codes such as -EINVAL and regmap_read()
failures. These values are implicitly converted to large unsigned
integers, resulting in invalid parent indices.

The clk_ops.get_parent() callback is expected to return a valid
parent index and does not support error codes. Fix this by returning
0 as a safe fallback in error cases.
A large number will exceed the number of parents possible for the clk
and turn into a failure to find the parent in the parent map. There's
nothing to do here besides implement clk_ops::get_parent_hw()[1] and fix
all the drivers.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/log/?h=clk-parent-rewrite
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help