From 8aa4aa7edf11e58c2e7e3338573e4f5c82ac5b33 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Fri, 20 Dec 2024 10:37:29 +0100 Subject: [PATCH] drivers: flash: stm32h7: do not unlock CR at the end of init Do not unlock CR at the end of initialization. The lock mechanism is to protect unwanted registers modifications due to software bugs. There is no point in leaving the registers unlock once the driver is initialized. Signed-off-by: Dawid Niedzwiecki --- drivers/flash/flash_stm32h7x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/flash/flash_stm32h7x.c b/drivers/flash/flash_stm32h7x.c index 89f8daf1f29220..5999865fbc62e1 100644 --- a/drivers/flash/flash_stm32h7x.c +++ b/drivers/flash/flash_stm32h7x.c @@ -767,7 +767,7 @@ static int stm32h7_flash_init(const struct device *dev) } #endif - return flash_stm32h7_write_protection(dev, false); + return 0; } DEVICE_DT_INST_DEFINE(0, stm32h7_flash_init, NULL, &flash_data, NULL, POST_KERNEL,