diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c index 3d7e19a514c..362367db96e 100644 --- a/drivers/gpio/gpio_stm32.c +++ b/drivers/gpio/gpio_stm32.c @@ -706,7 +706,8 @@ static int gpio_stm32_init(const struct device *dev) return -ENODEV; } -#if defined(PWR_CR2_IOSV) && DT_NODE_HAS_STATUS(DT_NODELABEL(gpiog), okay) +#if (defined(PWR_CR2_IOSV) || defined(PWR_SVMCR_IO2SV)) && \ + DT_NODE_HAS_STATUS(DT_NODELABEL(gpiog), okay) z_stm32_hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY); /* Port G[15:2] requires external power supply */ /* Cf: L4/L5 RM, Chapter "Independent I/O supply rail" */