Re: [PATCH] clk: mux: let clk_mux_val_to_index return U8_MAX in the error case

Stephen Boyd
2023-04-13T19:10:28Z

Quoting Heiner Kallweit (2023-04-11 23:19:04)
> Currently this function may return a negative errno, but almost no
> user checks for the error case. Only imx_clk_gpr_mux_get_parent()
> does, but mentions in a comment that they'd prefer a dummy value.
> Other users cast the negative errno to u8 instead, what may result
> in unwanted results.
> Let's deal with this by returning u8 and U8_MAX in the error case.
> Then clk_core_get_parent_by_index() can detect that the index is
> out of range.

Is this causing problems for you?