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

Brian Masney
2026-03-18T17:06:05Z

On Wed, Mar 18, 2026 at 11:02:51AM +0000, Anas Iqbal wrote:
> 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.
>
> Fixes: 734d82f4a678 ("clk: uniphier: add core support code for UniPhier clock driver")
> Signed-off-by: Anas Iqbal <mohd.abd.6602@gmail.com>

Reviewed-by: Brian Masney <bmasney@redhat.com>