diff options
| author | Benoît Monin <benoit.monin@bootlin.com> | 2025-10-20 09:28:00 +0200 |
|---|---|---|
| committer | Benoît Monin <benoit.monin@bootlin.com> | 2026-07-17 10:09:56 +0200 |
| commit | 46dda4d9750e10bbe9fae8a20ac3145179453e77 (patch) | |
| tree | 65087d92c637c717b403ff26c513bbb94b19da76 /include/linux | |
| parent | 379fc3b26b5774898c4061a25e81c0a58dde88e4 (diff) | |
clk: fixed-factor: Rework initialization with parent clocks
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 which
have a valid parent set.
In clk_factor_determine_rate(), make sure the parent clock is valid
before accessing it because the mis-configured fixed-factor now have a
NULL parent.
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
