Re: [PATCH v4 03/10] clk: fixed-factor: Rework initialization with parent clocks

From: Brian Masney

Date: Mon Mar 09 2026 - 10:59:07 EST


On Wed, Mar 04, 2026 at 04:25:17PM +0100, Benoît Monin wrote:
> Use the same sequence as clk-divider, clk-gate and other to set the
> parent_names, parent_hws and parent_data in the init struct when
> registering a fixed-factor clock. The number of parent clocks is now
> only set to one if a parent clock is provided.
>
> Previously the number of parent clocks was always one, forcing callers
> of __clk_hw_register_fixed_factor() to provide a dummy parent_data
> struct with an invalid clock index in case they were not provided with
> a non-NULL parent_name or parent_hw. Drop this dummy parent_data as is
> not necessary anymore.
>
> This change only has a small impact on mis-configured fixed-factor. Now a
> call to clk_hw_register_fixed_factor() with a NULL parent will register
> a fixed-factor with zero parent while previously it was registered with
> one invalid parent. In both cases the rate of the fixed-factor is 0Hz
> but it is no longer shown as orphaned.
>
> This has no impact on properly configured fixed-factors clocks.
>
> Signed-off-by: Benoît Monin <benoit.monin@xxxxxxxxxxx>

Reviewed-by: Brian Masney <bmasney@xxxxxxxxxx>