From 1d863fb74dd216af5cd37efbb4c92a106e2d3a5d 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. (cherry picked from commit 8aa4aa7edf11e58c2e7e3338573e4f5c82ac5b33) Original-Signed-off-by: Dawid Niedzwiecki GitOrigin-RevId: 8aa4aa7edf11e58c2e7e3338573e4f5c82ac5b33 Cr-Build-Id: 8726453333733413585 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8726453333733413585 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: Id8f1c8c33fe694ee04f88d5e270876942270e742 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6150711 Tested-by: ChromeOS Prod (Robot) Bot-Commit: ChromeOS Prod (Robot) Commit-Queue: ChromeOS Prod (Robot) --- 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 89f8daf1f29..5999865fbc6 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,