drivers: flash: Do not unlock CR at the end of initialization

Unlocking CR at the end of initialization was added in commit
a9183cd518. It was probably copied
from previous flash driver implementation.

Unlocking and locking CR in write and erase functions was added in
commit 6e4cdb0c99. Since we always unlock
the register before writing or erasing, and lock it after the operation
is finished, there is no need to unlock it after initialization.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
This commit is contained in:
Patryk Duda 2022-11-17 13:11:31 +01:00 committed by Carles Cufí
parent f3b0a8f478
commit b9f495282e

View File

@ -396,7 +396,7 @@ static int stm32_flash_init(const struct device *dev)
}
#endif
return flash_stm32_write_protection(dev, false);
return 0;
}
DEVICE_DT_INST_DEFINE(0, stm32_flash_init, NULL,