u-boot/drivers/clk
Sean Anderson 5e8317a9fa clk: Check that ops of composite clock components exist before calling
clk_composite_ops was shared between all devices in the composite clock
driver.  If one clock had a feature (such as supporting set_parent) which
another clock did not, it could call a null pointer dereference.

This patch does three things
1. It adds null-pointer checks to all composite clock functions.
2. It makes clk_composite_ops const and sets its functions at compile-time.
3. It adds some basic sanity checks to num_parents.

The combined effect of these changes is that any of mux, rate, or gate can
be NULL, and composite clocks will still function normally. Previously, at
least mux had to exist, since clk_composite_get_parent was used to
determine the parent for clk_register.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
2020-07-01 15:01:21 +08:00
..
altera common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
analogbits clk: sifive: Sync-up WRPLL library with upstream Linux 2019-07-19 14:24:51 +08:00
aspeed common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
at91 common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
exynos clk: Remove DM_FLAG_PRE_RELOC flag in various drivers 2018-11-14 09:16:28 -08:00
imx clk: Always use the supplied struct clk 2020-07-01 15:01:21 +08:00
intel x86: remove dead code in intel_clk_get_rate() 2020-03-05 18:19:40 +08:00
mediatek common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
meson common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mtmips clk: add clock driver for MediaTek MT76x8 platform 2019-10-25 17:20:44 +02:00
mvebu common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
owl common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
renesas common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rockchip rockchip: clk: rk3188: change APLL to safe 600MHz 2020-06-27 23:23:00 +08:00
sifive clk: sifive: fu540-prci: Release ethernet clock reset 2020-06-04 09:44:09 +08:00
sunxi common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
uniphier common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
clk_bcm6345.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_boston.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_fixed_factor.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
clk_fixed_rate.c clk: fixed_rate: add dummy enable() function 2020-01-16 09:39:45 -05:00
clk_pic32.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_sandbox_ccf.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_sandbox_test.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
clk_sandbox.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
clk_stm32f.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_stm32h7.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_stm32mp1.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_versal.c clk: versal: Remove alt_ref_clk from clock sources 2020-06-24 13:07:57 +02:00
clk_vexpress_osc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk_zynq.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
clk_zynqmp.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
clk-cdce9xx.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk-composite.c clk: Check that ops of composite clock components exist before calling 2020-07-01 15:01:21 +08:00
clk-divider.c clk: Always use the supplied struct clk 2020-07-01 15:01:21 +08:00
clk-fixed-factor.c clk: Always use the supplied struct clk 2020-07-01 15:01:21 +08:00
clk-gate.c clk: Always use the supplied struct clk 2020-07-01 15:01:21 +08:00
clk-hsdk-cgu.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clk-mux.c clk: Always use the supplied struct clk 2020-07-01 15:01:21 +08:00
clk-ti-sci.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
clk-uclass.c common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
clk.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ics8n3qv01.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Kconfig CLK: ARC: HSDK: add separate clock map for HSDK-4xD 2020-05-13 18:09:27 +03:00
Makefile x86: Add a clock driver for Intel devices 2020-02-07 22:41:24 +08:00
mpc83xx_clk.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mpc83xx_clk.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00