Skip to content

Commit

Permalink
[review] drivers: stm32_gpio: factorize apply_rif_config()
Browse files Browse the repository at this point in the history
Assert there is a GPIO configuration for the GPIOs for which
apply_rif_config() is called.

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Nov 12, 2024
1 parent c3886b1 commit 31d7a49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/drivers/stm32_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 31d7a49

Please sign in to comment.