linux/drivers/clk/microchip
Brian Masney 563a6ab857 clk: microchip: core: correct return value on *_get_parent()
[ Upstream commit 5df96d141c ]

roclk_get_parent() and sclk_get_parent() has the possibility of
returning -EINVAL, however the framework expects this call to always
succeed since the return value is unsigned.

If there is no parent map defined, then the current value programmed in
the hardware is used. Let's use that same value in the case where
-EINVAL is currently returned.

This index is only used by clk_core_get_parent_by_index(), and it
validates that it doesn't overflow the number of available parents.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202512050233.R9hAWsJN-lkp@intel.com/
Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/20251205-clk-microchip-fixes-v3-2-a02190705e47@redhat.com
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:21:22 -05:00
..
clk-core.c clk: microchip: core: correct return value on *_get_parent() 2026-03-04 07:21:22 -05:00
clk-core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
clk-mpfs-ccc.c clk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.h 2023-12-17 14:47:43 -08:00
clk-mpfs.c clock, reset: microchip: move all mpfs reset code to the reset subsystem 2024-05-07 14:57:46 -07:00
clk-pic32mzda.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
Kconfig clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE 2023-05-22 11:57:27 +03:00
Makefile clk: microchip: add PolarFire SoC fabric clock support 2022-09-14 10:57:07 +03:00