From 31d7a49f3ccfde84c99043050b2d8f106592e6e1 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Tue, 12 Nov 2024 17:52:40 +0100 Subject: [PATCH] [review] drivers: stm32_gpio: factorize apply_rif_config() Assert there is a GPIO configuration for the GPIOs for which apply_rif_config() is called. Signed-off-by: Etienne Carriere --- core/drivers/stm32_gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/drivers/stm32_gpio.c b/core/drivers/stm32_gpio.c index 52a7d3b1d11..753ead6d221 100644 --- a/core/drivers/stm32_gpio.c +++ b/core/drivers/stm32_gpio.c @@ -867,6 +867,9 @@ static TEE_Result apply_rif_config(struct stm32_gpio_bank *bank, if (!bank->rif_cfg) return TEE_SUCCESS; + /* Expect a valid config for the GPIOs we're about to configure */ + assert((gpios_mask & bank->rif_cfg->access_mask[0]) == gpios_mask); + if (clk_enable(bank->clock)) panic();